Re: Detecting which columns a query will modify in a function calledby a trigger - Mailing list pgsql-general

From David G. Johnston
Subject Re: Detecting which columns a query will modify in a function calledby a trigger
Date
Msg-id CAKFQuwaYuvQert-Szy7khu4tB6avCah0wqavsQzPDxX+-vjj_g@mail.gmail.com
Whole thread Raw
In response to Re: Detecting which columns a query will modify in a function calledby a trigger  (stan <stanb@panix.com>)
Responses Re: Detecting which columns a query will modify in a function calledby a trigger  (stan <stanb@panix.com>)
List pgsql-general
On Mon, Mar 2, 2020 at 1:28 PM stan <stanb@panix.com> 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 columns need to be created by the receiving
department, some of the columns need to be created/modified by the accounts
payable department.

Make sense?

On a theory level this design is insufficiently normalized.  The fact that you are having issues and challenges working with it suggests you should seriously consider a different design, one that exhibits better normalization properties.

Alternatively you might consider just removing direct access to the table and provide views and/or functions that can use normal permission grants.  Add some check constraints to the table to describe and enforce the inter-field relationships that are present.

David J.

pgsql-general by date:

Previous
From: stan
Date:
Subject: Re: Detecting which columns a query will modify in a function calledby a trigger
Next
From: Tim Cross
Date:
Subject: Re: Detecting which columns a query will modify in a functioncalled by a trigger