Re: Trigger usecase

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: sud <suds1434(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Trigger usecase
Date: 2024-07-30 15:41:26
Message-ID: CAKFQuwZ1tfj-ycQR1tx=Qp9zO4O7gUj-wrJZKYX3hUtvFrB96g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 30, 2024 at 8:16 AM sud <suds1434(at)gmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2024-07-30 17:24:06 Re: Trigger usecase
Previous Message sud 2024-07-30 15:16:32 Trigger usecase