Re: Detecting which columns a query will modify in a function called by a trigger

2020-10-02 Thread David G. Johnston
On Tue, Mar 3, 2020 at 4:19 PM David G. Johnston wrote: > On Tue, Mar 3, 2020 at 4:11 PM Adrian Klaver > wrote: > >> On 3/3/20 3:06 PM, David G. Johnston wrote: >> > On Tue, Mar 3, 2020 at 3:48 PM Adrian Klaver > > > wrote: >> > >> > The link was for automat

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-03 Thread David G. Johnston
On Tue, Mar 3, 2020 at 4:11 PM Adrian Klaver wrote: > On 3/3/20 3:06 PM, David G. Johnston wrote: > > On Tue, Mar 3, 2020 at 3:48 PM Adrian Klaver > > wrote: > > > > The link was for automatically updateable views. If you want to do > > something more in

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-03 Thread Adrian Klaver
On 3/3/20 3:06 PM, David G. Johnston wrote: On Tue, Mar 3, 2020 at 3:48 PM Adrian Klaver > wrote: The link was for automatically updateable views. If you want to do something more involved then see: https://www.postgresql.org/docs/12/rules-views.htm

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-03 Thread David G. Johnston
On Tue, Mar 3, 2020 at 3:48 PM Adrian Klaver wrote: > The link was for automatically updateable views. If you want to do > something more involved then see: > > https://www.postgresql.org/docs/12/rules-views.html#RULES-VIEWS-UPDATE CREATE TRIGGER works with views; I usually see recommendations

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-03 Thread Adrian Klaver
On 3/3/20 1:32 PM, stan wrote: Please reply to list also. Ccing list On Tue, Mar 03, 2020 at 10:48:29AM -0800, Adrian Klaver wrote: On 3/3/20 9:42 AM, stan wrote: On Mon, Mar 02, 2020 at 01:44:52PM -0700, David G. Johnston wrote: On Mon, Mar 2, 2020 at 1:28 PM stan wrote: Envision a table w

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-03 Thread Hellmuth Vargas
hello By means of json you can detect what change between NEW and OLD example: select b.* from (values (now(),123456,'pepito perez',false)) as old(dato1,dato2,dato3,dato4),json_each_text(row_to_json(old)) as b(text1,text2) except select b.* from (values (now(),98765,'pepi

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-03 Thread Adrian Klaver
On 3/3/20 9:42 AM, stan wrote: On Mon, Mar 02, 2020 at 01:44:52PM -0700, David G. Johnston wrote: On Mon, Mar 2, 2020 at 1:28 PM stan wrote: Envision a table with a good many columns. This table represents the "life history" of a part on a project. Some of the columns need to be created/modif

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-03 Thread stan
On Mon, Mar 02, 2020 at 01:44:52PM -0700, David G. Johnston wrote: > On Mon, Mar 2, 2020 at 1:28 PM stan wrote: > > > Envision a table with a good many columns. This table represents the "life > > history" of a part on a project. Some of the columns need to be > > created/modified by the engineer

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-02 Thread Adrian Klaver
On 3/2/20 12:28 PM, stan wrote: On Mon, Mar 02, 2020 at 11:02:54AM -0800, Adrian Klaver wrote: On 3/2/20 10:59 AM, stan wrote: I need to implement a fairly fine grained security model. Probably a bit finer that I can do with the standard ownership functionality. My thinking on this is to creat

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-02 Thread Tim Cross
stan writes: > On Mon, Mar 02, 2020 at 11:02:54AM -0800, Adrian Klaver wrote: >> On 3/2/20 10:59 AM, stan wrote: >> > I need to implement a fairly fine grained security model. Probably a bit >> > finer that I can do with the standard ownership functionality. >> > >> > My thinking on this is to

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-02 Thread David G. Johnston
On Mon, Mar 2, 2020 at 1:28 PM stan wrote: > Envision a table with a good many columns. This table represents the "life > history" of a part on a project. Some of the columns need to be > created/modified by the engineer. Some need to be created/modified by the > purchasing agent, some of the col

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-02 Thread stan
On Mon, Mar 02, 2020 at 11:02:54AM -0800, Adrian Klaver wrote: > On 3/2/20 10:59 AM, stan wrote: > > I need to implement a fairly fine grained security model. Probably a bit > > finer that I can do with the standard ownership functionality. > > > > My thinking on this is to create a table that con

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-02 Thread Pavel Stehule
po 2. 3. 2020 v 19:59 odesílatel stan napsal: > I need to implement a fairly fine grained security model. Probably a bit > finer that I can do with the standard ownership functionality. > > My thinking on this is to create a table that contains the users, and a > "permission bit" for each functio

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-02 Thread Adrian Klaver
On 3/2/20 10:59 AM, stan wrote: I need to implement a fairly fine grained security model. Probably a bit finer that I can do with the standard ownership functionality. My thinking on this is to create a table that contains the users, and a "permission bit" for each function that they may want to