Re: Trigger usecase - Mailing list pgsql-general

From David G. Johnston
Subject Re: Trigger usecase
Date
Msg-id CAKFQuwZ1tfj-ycQR1tx=Qp9zO4O7gUj-wrJZKYX3hUtvFrB96g@mail.gmail.com
Whole thread Raw
In response to Trigger usecase  (sud <suds1434@gmail.com>)
List pgsql-general
On Tue, Jul 30, 2024 at 8:16 AM sud <suds1434@gmail.com> wrote:

I understand, technically its possible bith the way, but want to understand experts opinion on this and pros ans cons?


Have client code call a function that performs the relevant work directly instead of having a trigger perform similar work.

Probably should just remove insert/update/delete permissions from most users on that table as well, make the function owned by the table owner and with security definer so it is allowed to perform the needed work.  But the normal application user is unable to bypass using said function to perform DML on the table.

David J.

pgsql-general by date:

Previous
From: sud
Date:
Subject: Trigger usecase
Next
From: Laurenz Albe
Date:
Subject: Re: Trigger usecase