Re: error in trigger creation

2024-04-21 Thread Adrian Klaver
On 4/21/24 14:21, Tom Lane wrote: Adrian Klaver writes: On 4/21/24 11:20, yudhi s wrote: So in this case i was wondering if "event trigger" can cause any additional threat and thus there is no such privilege like "create trigger" exist in postgres and so it should be treated cautiously? An

Re: error in trigger creation

2024-04-21 Thread Tom Lane
Adrian Klaver writes: > On 4/21/24 11:20, yudhi s wrote: >> So in this case i was wondering if "event trigger" can cause any >> additional threat and thus there is no such privilege like "create >> trigger" exist in postgres and so it should be treated cautiously? > An event trigger runs as a

Re: error in trigger creation

2024-04-21 Thread Adrian Klaver
On 4/21/24 11:20, yudhi s wrote: On Sun, Apr 21, 2024 at 8:13 PM Tom Lane > wrote: So do you mean , we should not create the event trigger using the "security definer" , rather have the super user do this each time we have to create the event trigger?

Re: error in trigger creation

2024-04-21 Thread yudhi s
On Mon, 22 Apr, 2024, 1:34 am Ron Johnson, wrote: > On Sun, Apr 21, 2024 at 2:58 PM yudhi s > wrote: > >> the partition drop from parent is taking longer as it scans all the >> partitions of the child table >> > > Does the relevant supporting index exist on the child table? > Yes all the child

Re: error in trigger creation

2024-04-21 Thread Ron Johnson
On Sun, Apr 21, 2024 at 2:58 PM yudhi s wrote: > the partition drop from parent is taking longer as it scans all the > partitions of the child table > Does the relevant supporting index exist on the child table?

Re: error in trigger creation

2024-04-21 Thread yudhi s
On Mon, Apr 22, 2024 at 12:02 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > > I suggest you share a script that demonstrates exactly what you are trying > to accomplish. Which event triggers you need to create from the > application and what the functions those triggers call do. >

Re: error in trigger creation

2024-04-21 Thread David G. Johnston
On Sun, Apr 21, 2024 at 11:20 AM yudhi s wrote: > > On Sun, Apr 21, 2024 at 8:13 PM Tom Lane wrote: > >> "David G. Johnston" writes: >> > On Sunday, April 21, 2024, yudhi s wrote: >> >> Are you saying something like below, in which we first create the >> >> function from super user and then

Re: error in trigger creation

2024-04-21 Thread yudhi s
On Sun, Apr 21, 2024 at 8:13 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Sunday, April 21, 2024, yudhi s 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

Re: error in trigger creation

2024-04-21 Thread David G. Johnston
On Sun, Apr 21, 2024 at 11:10 AM yudhi s wrote: > > On Sun, Apr 21, 2024 at 7:55 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Sunday, April 21, 2024, yudhi s wrote: >> >>> On Sun, Apr 21, 2024 at 1:55 PM David G. Johnston < >>> david.g.johns...@gmail.com> wrote: >>>

Re: error in trigger creation

2024-04-21 Thread yudhi s
On Sun, Apr 21, 2024 at 7:55 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Sunday, April 21, 2024, yudhi s wrote: > >> On Sun, Apr 21, 2024 at 1:55 PM David G. Johnston < >> david.g.johns...@gmail.com> wrote: >> >>> On Sunday, April 21, 2024, yudhi s wrote: >>> so that it

Re: error in trigger creation

2024-04-21 Thread Tom Lane
"David G. Johnston" writes: > On Sunday, April 21, 2024, yudhi s 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 >>

Re: error in trigger creation

2024-04-21 Thread David G. Johnston
On Sunday, April 21, 2024, yudhi s wrote: > On Sun, Apr 21, 2024 at 1:55 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Sunday, April 21, 2024, yudhi s wrote: >> >>> so that it will be able to assign the privilege, so we will be able to >>> create the event trigger without

Re: error in trigger creation

2024-04-21 Thread yudhi s
On Sun, Apr 21, 2024 at 1:55 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Sunday, April 21, 2024, yudhi s wrote: > >> so that it will be able to assign the privilege, so we will be able to >> create the event trigger without need to run the event trigger script from >> super

Re: error in trigger creation

2024-04-21 Thread David G. Johnston
On Sunday, April 21, 2024, yudhi s wrote: > so that it will be able to assign the privilege, so we will be able to > create the event trigger without need to run the event trigger script from > super user itself? > Write a security-definer function owned by superuser and grant app_user

error in trigger creation

2024-04-21 Thread yudhi s
Hi All, We are seeing privilege issues while creating event triggers. It says the user "*must be a superuser to create an event trigger*". So my question is , if we have application user as "app_user" which is responsible for creating database objects in schema "app_schema" and also we have all