Re: error in trigger creation - Mailing list pgsql-general

From Tom Lane
Subject Re: error in trigger creation
Date
Msg-id 2720974.1713710606@sss.pgh.pa.us
Whole thread Raw
In response to Re: error in trigger creation  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: error in trigger creation  (yudhi s <learnerdatabase99@gmail.com>)
List pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Sunday, April 21, 2024, yudhi s <learnerdatabase99@gmail.com> wrote:
>> Are you saying something like below, in which we first create the
>> function from super user and then execute the grant? But doesn't that mean,
>> each time we want to create a new event trigger we have to be again
>> dependent on the "super user" to modify the security definer function?

> Dynamic SQL.  See “execute” in plpgsql.

You might as well just give that user superuser and be done with it.
It's foolish to imagine that you have any shred of security left
if you're letting a user that's not 100.00% trusted write event
triggers.  (Much less execute any SQL command whatsoever, which
is what it sounds like David is suggesting you create a function
to do.)

            regards, tom lane



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: error in trigger creation
Next
From: Adrian Klaver
Date:
Subject: Re: Logging statement having any threat?