Re: On login trigger: take three

2022-02-15 Thread Greg Nancarrow
On Mon, Jan 24, 2022 at 1:59 PM Greg Nancarrow wrote: > > I've attached a re-based version (no functional changes from the > previous) to fix cfbot failures. > I've attached a re-based version (no functional changes from the previous) to fix cfbot failures. Regards, Greg Nancarrow Fujitsu

Re: On login trigger: take three

2022-01-23 Thread Greg Nancarrow
On Mon, Dec 6, 2021 at 12:10 PM Greg Nancarrow wrote: > > I've attached a re-based version (no functional changes from the > previous) to fix cfbot failures. > I've attached a re-based version (no functional changes from the previous) to fix cfbot failures. Regards, Greg Nancarrow Fujitsu

Re: On login trigger: take three

2021-12-05 Thread Greg Nancarrow
On Tue, Nov 16, 2021 at 4:38 PM Greg Nancarrow wrote: > > I've attached an updated patch with these changes. > I've attached a re-based version (no functional changes from the previous) to fix cfbot failures. Regards, Greg Nancarrow Fujitsu Australia

Re: On login trigger: take three

2021-11-15 Thread Greg Nancarrow
On Thu, Nov 11, 2021 at 8:56 PM Daniel Gustafsson wrote: > > +This flag is used to avoid extra lookups on the pg_event_trigger > table during each backend startup. > This should be pg_event_trigger. Sorry, missed that > one at that last read-through. > Fixed. > > - dathaslogintriggers

Re: On login trigger: take three

2021-11-11 Thread Greg Nancarrow
On Thu, Nov 11, 2021 at 8:56 PM Daniel Gustafsson wrote: > > +This flag is used to avoid extra lookups on the pg_event_trigger > table during each backend startup. > This should be pg_event_trigger. Sorry, missed that > one at that last read-through. > Thanks, noted. > > -

Re: On login trigger: take three

2021-11-11 Thread Daniel Gustafsson
> On 11 Nov 2021, at 07:37, Greg Nancarrow wrote: > I've attached an updated patch, that essentially reinstates the v19 > patch Thanks! I've only skimmed it so far but it looks good, will do a more thorough review soon. +This flag is used to avoid extra lookups on the pg_event_trigger

Re: On login trigger: take three

2021-11-10 Thread Greg Nancarrow
On Wed, Nov 10, 2021 at 8:11 PM Daniel Gustafsson wrote: > > > If there are no objections, I plan to reinstate the previous v19 patch > > (as v21), perhaps with a few minor improvements and cleanups (e.g. SQL > > capitalization) in the tests, as hinted at in the v20 patch, but no > > new

Re: On login trigger: take three

2021-11-10 Thread Pavel Stehule
st 10. 11. 2021 v 10:11 odesílatel Daniel Gustafsson napsal: > > On 10 Nov 2021, at 08:12, Greg Nancarrow wrote: > > > > On Fri, Nov 5, 2021 at 3:03 PM Greg Nancarrow > wrote: > >> > >> +1 > >> The arguments given are pretty convincing IMHO, and I agree that the > additions made in the v20

Re: On login trigger: take three

2021-11-10 Thread Daniel Gustafsson
> On 10 Nov 2021, at 08:12, Greg Nancarrow wrote: > > On Fri, Nov 5, 2021 at 3:03 PM Greg Nancarrow wrote: >> >> +1 >> The arguments given are pretty convincing IMHO, and I agree that the >> additions made in the v20 patch are not a good idea, and are not needed. > > If there are no

Re: On login trigger: take three

2021-11-09 Thread Greg Nancarrow
On Fri, Nov 5, 2021 at 3:03 PM Greg Nancarrow wrote: > > +1 > The arguments given are pretty convincing IMHO, and I agree that the > additions made in the v20 patch are not a good idea, and are not needed. > If there are no objections, I plan to reinstate the previous v19 patch (as v21),

Re: On login trigger: take three

2021-11-04 Thread Greg Nancarrow
On Thu, Nov 4, 2021 at 7:43 AM Daniel Gustafsson wrote: > > On 3 Nov 2021, at 17:15, Ivan Panchenko wrote: > > Среда, 29 сентября 2021, 15:14 +03:00 от Teodor Sigaev >: > > 2 For logging purpose failing of trigger will cause impossibility to > login, it > > could be workarounded by catching

Re: On login trigger: take three

2021-11-03 Thread Daniel Gustafsson
> On 3 Nov 2021, at 17:15, Ivan Panchenko wrote: > Среда, 29 сентября 2021, 15:14 +03:00 от Teodor Sigaev >: > 2 For logging purpose failing of trigger will cause impossibility to login, it > could be workarounded by catching error in trigger function, but it's not so > obvious for DBA. > If the

Re[2]: On login trigger: take three

2021-11-03 Thread Ivan Panchenko
Dear colleagues,  Please see my suggestions below and the updated patch attached.           >Среда, 29 сентября 2021, 15:14 +03:00 от Teodor Sigaev < teo...@sigaev.ru >: >  >Hi! > >Nice feature, but, sorry, I see some design problem in suggested feature. >AFAIK, >there is two use cases for this

Re: On login trigger: take three

2021-10-04 Thread Greg Nancarrow
On Wed, Sep 15, 2021 at 11:32 PM Greg Nancarrow wrote: > > I've attached the updated patch. > Attached a rebased version of the patch, as it was broken by fairly recent changes (only very minor change to the previous version). Regards, Greg Nancarrow Fujitsu Australia

Re: On login trigger: take three

2021-09-30 Thread Daniel Gustafsson
> On 30 Sep 2021, at 04:15, Greg Nancarrow wrote: > > On Wed, Sep 29, 2021 at 10:14 PM Teodor Sigaev wrote: >> >> Nice feature, but, sorry, I see some design problem in suggested feature. >> AFAIK, >> there is two use cases for this feature: >> 1 A permission / prohibition to login some users

Re: On login trigger: take three

2021-09-29 Thread Greg Nancarrow
On Wed, Sep 29, 2021 at 10:14 PM Teodor Sigaev wrote: > > Nice feature, but, sorry, I see some design problem in suggested feature. > AFAIK, > there is two use cases for this feature: > 1 A permission / prohibition to login some users > 2 Just a logging of facts of user's login > > Suggested

Re: On login trigger: take three

2021-09-29 Thread Teodor Sigaev
Hi! Nice feature, but, sorry, I see some design problem in suggested feature. AFAIK, there is two use cases for this feature: 1 A permission / prohibition to login some users 2 Just a logging of facts of user's login Suggested patch proposes prohibition of login only by failing of login

Re: On login trigger: take three

2021-09-15 Thread Greg Nancarrow
On Wed, Sep 8, 2021 at 10:56 PM Daniel Gustafsson wrote: > > I took a look at this, and while I like the proposed feature I think the patch > has a bit more work required. > Thanks for reviewing the patch. I am not the original patch author (who no longer seems active) but I've been contributing

Re: On login trigger: take three

2021-09-08 Thread Pavel Stehule
st 8. 9. 2021 v 20:23 odesílatel Daniel Gustafsson napsal: > > On 8 Sep 2021, at 16:02, Pavel Stehule wrote: > > > In the time when event triggers were introduced, managed services were > not too widely used like now. When we discussed this feature we thought > about environments when users

Re: On login trigger: take three

2021-09-08 Thread Daniel Gustafsson
> On 8 Sep 2021, at 16:02, Pavel Stehule wrote: > In the time when event triggers were introduced, managed services were not > too widely used like now. When we discussed this feature we thought about > environments when users have no superuser rights and have no possibility to > go to single

Re: On login trigger: take three

2021-09-08 Thread Pavel Stehule
Hi > + {"enable_client_connection_trigger", PGC_SU_BACKEND, > DEVELOPER_OPTIONS, > + gettext_noop("Enables the client_connection event > trigger."), > + gettext_noop("In case of errors in the ON > client_connection EVENT TRIGGER procedure, " > ..and.. > +

Re: On login trigger: take three

2021-09-08 Thread Daniel Gustafsson
> On 19 Jul 2021, at 15:25, Greg Nancarrow wrote: > Attached a rebased patch (minor updates to the test code). I took a look at this, and while I like the proposed feature I think the patch has a bit more work required. +END IF; + +-- 2) Initialize some user session data + CREATE TEMP

Re: Re[5]: On login trigger: take three

2021-08-16 Thread Greg Nancarrow
On Tue, Aug 17, 2021 at 1:11 AM Ivan Panchenko wrote: > > Does it mean that "RAISE NOTICE" should’t be used, or behaves unexpectedly in > logon triggers? Should we mention this in the docs? > No I don't believe so, it was just that that part of the test framework (sub poll_query_until) had been

Re[5]: On login trigger: take three

2021-08-16 Thread Ivan Panchenko
  Hi Greg,   >Среда, 7 июля 2021, 3:55 +03:00 от Greg Nancarrow : >  >On Sun, Jul 4, 2021 at 1:21 PM vignesh C < vignes...@gmail.com > wrote: >> >> CFBot shows the following failure: >> # poll_query_until timed out executing this query: >> # SELECT '0/3046250' <= replay_lsn AND state =

Re: Re[3]: On login trigger: take three

2021-07-19 Thread Greg Nancarrow
On Mon, Jul 19, 2021 at 8:18 PM Ibrar Ahmed wrote: > > The patch does not apply, and rebase is required. > Attached a rebased patch (minor updates to the test code). Regards, Greg Nancarrow Fujitsu Australia v17-0001-on_client_connect_event_trigger.patch Description: Binary data

Re: Re[3]: On login trigger: take three

2021-07-19 Thread Ibrar Ahmed
On Wed, Jul 7, 2021 at 5:55 AM Greg Nancarrow wrote: > On Sun, Jul 4, 2021 at 1:21 PM vignesh C wrote: > > > > CFBot shows the following failure: > > # poll_query_until timed out executing this query: > > # SELECT '0/3046250' <= replay_lsn AND state = 'streaming' FROM > >

Re: Re[3]: On login trigger: take three

2021-07-06 Thread Greg Nancarrow
On Sun, Jul 4, 2021 at 1:21 PM vignesh C wrote: > > CFBot shows the following failure: > # poll_query_until timed out executing this query: > # SELECT '0/3046250' <= replay_lsn AND state = 'streaming' FROM > pg_catalog.pg_stat_replication WHERE application_name = 'standby_1'; > # expecting this

Re: Re[3]: On login trigger: take three

2021-07-03 Thread vignesh C
On Thu, Jun 3, 2021 at 8:36 AM Greg Nancarrow wrote: > > On Fri, May 21, 2021 at 2:46 PM Greg Nancarrow wrote: > > > > On Thu, May 20, 2021 at 2:45 PM Ivan Panchenko wrote: > > > > > > I have upgraded the patch for the 14th version. > > > > > > > I have some feedback on the patch: > > > > I've

Re: Re[3]: On login trigger: take three

2021-06-02 Thread Greg Nancarrow
On Fri, May 21, 2021 at 2:46 PM Greg Nancarrow wrote: > > On Thu, May 20, 2021 at 2:45 PM Ivan Panchenko wrote: > > > > I have upgraded the patch for the 14th version. > > > > I have some feedback on the patch: > I've attached an updated version of the patch. I've applied my review comments and

Re: Re[3]: On login trigger: take three

2021-05-20 Thread Greg Nancarrow
On Thu, May 20, 2021 at 2:45 PM Ivan Panchenko wrote: > > I have upgraded the patch for the 14th version. > I have some feedback on the patch: (1) The patch adds 3 whitespace errors ("git apply " reports 3 warnings) (2) doc/src/sgml/catalogs.sgml CURRENTLY: This flag is used to avoid extra

Re[3]: On login trigger: take three

2021-05-19 Thread Ivan Panchenko
Hi, I have upgraded the patch for the 14th version. >Вторник, 16 марта 2021, 14:32 +03:00 от Ivan Panchenko : >  >Hi, > >Thank you, Konstantin, for this very good feature with numerous use cases. >Please find the modified patch attached. > >I’ve added the ‘enable_client_connection_trigger’ GUC to

Re[2]: On login trigger: take three

2021-03-16 Thread Ivan Panchenko
Hi, Thank you, Konstantin, for this very good feature with numerous use cases. Please find the modified patch attached. I’ve added the ‘enable_client_connection_trigger’ GUC to the sample config file and also an additional example page to the docs. Check world has passed and it is ready for

Re: On login trigger: take three

2021-01-28 Thread Konstantin Knizhnik
On 28.01.2021 5:47, Amit Kapila wrote: On Mon, Dec 28, 2020 at 5:46 PM Masahiko Sawada wrote: On Sat, Dec 26, 2020 at 4:04 PM Pavel Stehule wrote: so 26. 12. 2020 v 8:00 odesílatel Pavel Stehule napsal: Hi Thank you. I have applied all your fixes in

Re: On login trigger: take three

2021-01-27 Thread Amit Kapila
On Thu, Jan 28, 2021 at 8:17 AM Amit Kapila wrote: > > On Mon, Dec 28, 2020 at 5:46 PM Masahiko Sawada wrote: > > > > On Sat, Dec 26, 2020 at 4:04 PM Pavel Stehule > > wrote: > > > > > > > > > > > > so 26. 12. 2020 v 8:00 odesílatel Pavel Stehule > > > napsal: > > >> > > >> Hi > > >> > > >>

Re: On login trigger: take three

2021-01-27 Thread Amit Kapila
On Mon, Dec 28, 2020 at 5:46 PM Masahiko Sawada wrote: > > On Sat, Dec 26, 2020 at 4:04 PM Pavel Stehule wrote: > > > > > > > > so 26. 12. 2020 v 8:00 odesílatel Pavel Stehule > > napsal: > >> > >> Hi > >> > >> > >>> Thank you. > >>> I have applied all your fixes in

Re: On login trigger: take three

2020-12-28 Thread Masahiko Sawada
On Sat, Dec 26, 2020 at 4:04 PM Pavel Stehule wrote: > > > > so 26. 12. 2020 v 8:00 odesílatel Pavel Stehule > napsal: >> >> Hi >> >> >>> Thank you. >>> I have applied all your fixes in on_connect_event_trigger-12.patch. >>> >>> Concerning enable_client_connection_trigger GUC, I think that it

Re: On login trigger: take three

2020-12-25 Thread Pavel Stehule
so 26. 12. 2020 v 8:00 odesílatel Pavel Stehule napsal: > Hi > > > Thank you. >> I have applied all your fixes in on_connect_event_trigger-12.patch. >> >> Concerning enable_client_connection_trigger GUC, I think that it is >> really useful: it is the fastest and simplest way to disable login

Re: On login trigger: take three

2020-12-25 Thread Pavel Stehule
Hi Thank you. > I have applied all your fixes in on_connect_event_trigger-12.patch. > > Concerning enable_client_connection_trigger GUC, I think that it is really > useful: it is the fastest and simplest way to disable login triggers in case > of some problems with them (not only for superuser

Re: On login trigger: take three

2020-12-24 Thread Konstantin Knizhnik
On 22.12.2020 21:19, Pavel Stehule wrote: út 22. 12. 2020 v 12:42 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>> napsal: On 22.12.2020 12:25, Pavel Stehule wrote: regress tests fails      sysviews                     ... FAILED    112 ms test

Re: On login trigger: take three

2020-12-22 Thread Pavel Stehule
út 22. 12. 2020 v 12:42 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 22.12.2020 12:25, Pavel Stehule wrote: > > > regress tests fails > > sysviews ... FAILED 112 ms > test event_trigger... FAILED (test process exited

Re: On login trigger: take three

2020-12-22 Thread Konstantin Knizhnik
On 22.12.2020 12:25, Pavel Stehule wrote: regress tests fails      sysviews                     ... FAILED      112 ms test event_trigger                ... FAILED (test process exited with exit code 2)      447 ms test fast_default                 ... FAILED      392 ms test stats        

Re: On login trigger: take three

2020-12-22 Thread Pavel Stehule
Hi po 21. 12. 2020 v 11:06 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 20.12.2020 10:04, Pavel Stehule wrote: > > > > čt 17. 12. 2020 v 19:30 odesílatel Pavel Stehule > napsal: > >> >> >> čt 17. 12. 2020 v 14:04 odesílatel Konstantin Knizhnik < >>

Re: On login trigger: take three

2020-12-21 Thread Konstantin Knizhnik
On 20.12.2020 10:04, Pavel Stehule wrote: čt 17. 12. 2020 v 19:30 odesílatel Pavel Stehule mailto:pavel.steh...@gmail.com>> napsal: čt 17. 12. 2020 v 14:04 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>> napsal: On 17.12.2020 9:31, Pavel Stehule

Re: On login trigger: take three

2020-12-19 Thread Pavel Stehule
čt 17. 12. 2020 v 19:30 odesílatel Pavel Stehule napsal: > > > čt 17. 12. 2020 v 14:04 odesílatel Konstantin Knizhnik < > k.knizh...@postgrespro.ru> napsal: > >> >> >> On 17.12.2020 9:31, Pavel Stehule wrote: >> >> >> >> st 16. 12. 2020 v 20:38 odesílatel Pavel Stehule >> napsal: >> >>>

Re: On login trigger: take three

2020-12-17 Thread Pavel Stehule
čt 17. 12. 2020 v 14:04 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 17.12.2020 9:31, Pavel Stehule wrote: > > > > st 16. 12. 2020 v 20:38 odesílatel Pavel Stehule > napsal: > >> Attached please find new versoin of the patch based on >>

Re: On login trigger: take three

2020-12-17 Thread Konstantin Knizhnik
Hi, On 17.12.2020 3:31, Zhihong Yu wrote: Hi, For EventTriggerOnConnect(): +           PG_CATCH(); +           { ... +               AbortCurrentTransaction(); +               return; Should runlist be freed in the catch block ? No need: it is allocated in transaction memory context and

Re: On login trigger: take three

2020-12-17 Thread Konstantin Knizhnik
On 17.12.2020 9:31, Pavel Stehule wrote: st 16. 12. 2020 v 20:38 odesílatel Pavel Stehule mailto:pavel.steh...@gmail.com>> napsal: Attached please find new versoin of the patch based on on_connect_event_trigger_WITH_SUGGESTED_UPDATES.patch So there is still only

Re: On login trigger: take three

2020-12-16 Thread Pavel Stehule
st 16. 12. 2020 v 20:38 odesílatel Pavel Stehule napsal: > Attached please find new versoin of the patch based on > on_connect_event_trigger_WITH_SUGGESTED_UPDATES.patch > >> So there is still only "disable_client_connection_trigger" GUC? because >> we need possibility to disable client connect

Re: On login trigger: take three

2020-12-16 Thread Zhihong Yu
Hi, For EventTriggerOnConnect(): + PG_CATCH(); + { ... + AbortCurrentTransaction(); + return; Should runlist be freed in the catch block ? + gettext_noop("In case of errors in the ON client_connection EVENT TRIGGER procedure, this

Re: On login trigger: take three

2020-12-16 Thread Pavel Stehule
Attached please find new versoin of the patch based on on_connect_event_trigger_WITH_SUGGESTED_UPDATES.patch > So there is still only "disable_client_connection_trigger" GUC? because > we need possibility to disable client connect triggers and there is no such > need for other event types. > >

Re: On login trigger: take three

2020-12-16 Thread Konstantin Knizhnik
On 15.12.2020 20:16, Pavel Stehule wrote: Please notice that we still need GUC to disable on-login triggers: to make it possible for superuser who did mistake and defined incorrect on-login trigger to login to the system. Do we need GUC to disable all

Re: On login trigger: take three

2020-12-15 Thread Pavel Stehule
> Please notice that we still need GUC to disable on-login triggers: to make >> it possible for superuser who did mistake and defined incorrect on-login >> trigger to >> login to the system. >> Do we need GUC to disable all other event triggers? May be I am wrong, >> but I do not see much need in

Re: On login trigger: take three

2020-12-15 Thread Konstantin Knizhnik
On 15.12.2020 18:25, Pavel Stehule wrote: út 15. 12. 2020 v 15:06 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>> napsal: On 15.12.2020 16:18, Pavel Stehule wrote: út 15. 12. 2020 v 14:12 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>>

Re: On login trigger: take three

2020-12-15 Thread Pavel Stehule
út 15. 12. 2020 v 15:06 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 15.12.2020 16:18, Pavel Stehule wrote: > > > > út 15. 12. 2020 v 14:12 odesílatel Konstantin Knizhnik < > k.knizh...@postgrespro.ru> napsal: > >> >> >> On 11.12.2020 19:27, Pavel Stehule wrote: >>

Re: On login trigger: take three

2020-12-15 Thread Pavel Stehule
út 15. 12. 2020 v 15:06 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 15.12.2020 16:18, Pavel Stehule wrote: > > > > út 15. 12. 2020 v 14:12 odesílatel Konstantin Knizhnik < > k.knizh...@postgrespro.ru> napsal: > >> >> >> On 11.12.2020 19:27, Pavel Stehule wrote: >>

Re: On login trigger: take three

2020-12-15 Thread Konstantin Knizhnik
On 15.12.2020 16:18, Pavel Stehule wrote: út 15. 12. 2020 v 14:12 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>> napsal: On 11.12.2020 19:27, Pavel Stehule wrote: pá 11. 12. 2020 v 17:05 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>>

Re: On login trigger: take three

2020-12-15 Thread Pavel Stehule
út 15. 12. 2020 v 14:12 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 11.12.2020 19:27, Pavel Stehule wrote: > > > > pá 11. 12. 2020 v 17:05 odesílatel Konstantin Knizhnik < > k.knizh...@postgrespro.ru> napsal: > >> >> >> On 11.12.2020 18:40, Pavel Stehule wrote: >>

Re: On login trigger: take three

2020-12-15 Thread Konstantin Knizhnik
On 11.12.2020 19:27, Pavel Stehule wrote: pá 11. 12. 2020 v 17:05 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>> napsal: On 11.12.2020 18:40, Pavel Stehule wrote: is not correct. It makes it not possible to superuser to disable triggers for all

Re: On login trigger: take three

2020-12-11 Thread Pavel Stehule
pá 11. 12. 2020 v 17:05 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 11.12.2020 18:40, Pavel Stehule wrote: > > > is not correct. It makes it not possible to superuser to disable triggers >> for all users. >> > > pg_database_ownercheck returns true for superuser

Re: On login trigger: take three

2020-12-11 Thread Pavel Stehule
pá 11. 12. 2020 v 16:07 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 09.12.2020 15:24, Pavel Stehule wrote: > > > > st 9. 12. 2020 v 13:17 odesílatel Greg Nancarrow > napsal: > >> On Tue, Dec 8, 2020 at 3:26 PM Pavel Stehule >> wrote: >> > >> > >> > There are two

Re: On login trigger: take three

2020-12-11 Thread Konstantin Knizhnik
On 09.12.2020 15:24, Pavel Stehule wrote: st 9. 12. 2020 v 13:17 odesílatel Greg Nancarrow > napsal: On Tue, Dec 8, 2020 at 3:26 PM Pavel Stehule mailto:pavel.steh...@gmail.com>> wrote: > > > There are two maybe generic questions? > >

Re: On login trigger: take three

2020-12-11 Thread Konstantin Knizhnik
On 10.12.2020 21:09, Pavel Stehule wrote: čt 10. 12. 2020 v 16:48 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>> napsal: On 10.12.2020 18:12, Pavel Stehule wrote: My idea was a little bit different. Inside postinit initialize some global variables with

Re: On login trigger: take three

2020-12-10 Thread Pavel Stehule
čt 10. 12. 2020 v 19:09 odesílatel Pavel Stehule napsal: > > > čt 10. 12. 2020 v 16:48 odesílatel Konstantin Knizhnik < > k.knizh...@postgrespro.ru> napsal: > >> >> >> On 10.12.2020 18:12, Pavel Stehule wrote: >> >> >> My idea was a little bit different. Inside postinit initialize some >> global

Re: On login trigger: take three

2020-12-10 Thread Pavel Stehule
čt 10. 12. 2020 v 16:48 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 10.12.2020 18:12, Pavel Stehule wrote: > > > My idea was a little bit different. Inside postinit initialize some global > variables with info if there are event triggers or not. And later you can

Re: On login trigger: take three

2020-12-10 Thread Konstantin Knizhnik
On 10.12.2020 18:12, Pavel Stehule wrote: My idea was a little bit different. Inside postinit initialize some global variables with info if there are event triggers or not. And later you can use this variable to start transactions and  other things. There will be two access to

Re: On login trigger: take three

2020-12-10 Thread Pavel Stehule
čt 10. 12. 2020 v 14:03 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 10.12.2020 10:45, Pavel Stehule wrote: > > > > st 9. 12. 2020 v 14:28 odesílatel Konstantin Knizhnik < > k.knizh...@postgrespro.ru> napsal: > >> >> >> On 09.12.2020 15:34, Pavel Stehule wrote: >>

Re: On login trigger: take three

2020-12-10 Thread Konstantin Knizhnik
On 10.12.2020 10:45, Pavel Stehule wrote: st 9. 12. 2020 v 14:28 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>> napsal: On 09.12.2020 15:34, Pavel Stehule wrote: Hi st 9. 12. 2020 v 13:17 odesílatel Greg Nancarrow mailto:gregn4...@gmail.com>> napsal:

Re: On login trigger: take three

2020-12-09 Thread Pavel Stehule
st 9. 12. 2020 v 14:28 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 09.12.2020 15:34, Pavel Stehule wrote: > > Hi > > st 9. 12. 2020 v 13:17 odesílatel Greg Nancarrow > napsal: > >> On Tue, Dec 8, 2020 at 3:26 PM Pavel Stehule >> wrote: >> > >> > >> > There are

Re: On login trigger: take three

2020-12-09 Thread Konstantin Knizhnik
On 09.12.2020 15:34, Pavel Stehule wrote: Hi st 9. 12. 2020 v 13:17 odesílatel Greg Nancarrow > napsal: On Tue, Dec 8, 2020 at 3:26 PM Pavel Stehule mailto:pavel.steh...@gmail.com>> wrote: > > > There are two maybe generic questions? >

Re: On login trigger: take three

2020-12-09 Thread Pavel Stehule
Hi st 9. 12. 2020 v 13:17 odesílatel Greg Nancarrow napsal: > On Tue, Dec 8, 2020 at 3:26 PM Pavel Stehule > wrote: > > > > > > There are two maybe generic questions? > > > > 1. Maybe we can introduce more generic GUC for all event triggers like > disable_event_triggers? This GUC can be

Re: On login trigger: take three

2020-12-09 Thread Pavel Stehule
st 9. 12. 2020 v 13:17 odesílatel Greg Nancarrow napsal: > On Tue, Dec 8, 2020 at 3:26 PM Pavel Stehule > wrote: > > > > > > There are two maybe generic questions? > > > > 1. Maybe we can introduce more generic GUC for all event triggers like > disable_event_triggers? This GUC can be checked

Re: On login trigger: take three

2020-12-09 Thread Greg Nancarrow
On Tue, Dec 8, 2020 at 3:26 PM Pavel Stehule wrote: > > > There are two maybe generic questions? > > 1. Maybe we can introduce more generic GUC for all event triggers like > disable_event_triggers? This GUC can be checked only by the database owner or > super user. It can be an alternative

Re: On login trigger: take three

2020-12-07 Thread Pavel Stehule
út 8. 12. 2020 v 1:17 odesílatel Greg Nancarrow napsal: > On Fri, Dec 4, 2020 at 9:05 PM Konstantin Knizhnik > wrote: > > > > As far as I understand Pavel concern was about the case when superuser > > defines wrong login trigger which prevents login to the system > > all user including himself.

Re: On login trigger: take three

2020-12-07 Thread Greg Nancarrow
On Fri, Dec 4, 2020 at 9:05 PM Konstantin Knizhnik wrote: > > As far as I understand Pavel concern was about the case when superuser > defines wrong login trigger which prevents login to the system > all user including himself. Right now solution of this problem is to > include "options='-c

Re: On login trigger: take three

2020-12-04 Thread Konstantin Knizhnik
On 04.12.2020 3:50, Greg Nancarrow wrote: On Tue, Sep 15, 2020 at 2:12 AM Pavel Stehule wrote: It is always possible to login by disabling startup triggers using disable_session_start_trigger GUC: psql "dbname=postgres options='-c disable_session_start_trigger=true'" sure, I know. Just

Re: On login trigger: take three

2020-12-03 Thread Greg Nancarrow
On Tue, Sep 15, 2020 at 2:12 AM Pavel Stehule wrote: > >> >> It is always possible to login by disabling startup triggers using >> disable_session_start_trigger GUC: >> >> psql "dbname=postgres options='-c disable_session_start_trigger=true'" > > > sure, I know. Just this behavior can be a very

Re: On login trigger: take three

2020-09-14 Thread Pavel Stehule
po 14. 9. 2020 v 17:53 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 14.09.2020 17:34, Pavel Stehule wrote: > > If we introduce buildin session trigger , we should to define what is the > session. Your design is much more related to the process than to session. > So

Re: On login trigger: take three

2020-09-14 Thread Konstantin Knizhnik
On 14.09.2020 17:34, Pavel Stehule wrote: If we introduce buildin session trigger , we should to define what is the session. Your design is much more related to the process than to session. So the correct name should be "process_start" trigger, or some should be different. I think there are

Re: On login trigger: take three

2020-09-14 Thread Pavel Stehule
po 14. 9. 2020 v 16:12 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > > > On 14.09.2020 12:44, Pavel Stehule wrote: > > Hi > > > > I am checking last patch, and there are notices > > > > 1. disable_session_start_trigger should be SU_BACKEND instead SUSET > > > > 2. The

Re: On login trigger: take three

2020-09-14 Thread Konstantin Knizhnik
On 14.09.2020 12:44, Pavel Stehule wrote: Hi I am checking last patch, and there are notices 1. disable_session_start_trigger should be SU_BACKEND instead SUSET 2. The documentation should be enhanced - there is not any note about behave when there are unhandled exceptions, about

Re: On login trigger: take three

2020-09-14 Thread Pavel Stehule
Hi I am checking last patch, and there are notices 1. disable_session_start_trigger should be SU_BACKEND instead SUSET 2. The documentation should be enhanced - there is not any note about behave when there are unhandled exceptions, about motivation for this event trigger 3. regress tests

Re: On login trigger: take three

2020-09-11 Thread Konstantin Knizhnik
On 03.09.2020 17:18, Pavel Stehule wrote: Hi čt 3. 9. 2020 v 15:43 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>> napsal: Hi hackers, Recently I have asked once again by one of our customers about login trigger in postgres. People are migrating to Postgres

Re: On login trigger: take three

2020-09-04 Thread Konstantin Knizhnik
Sorry, attached version of the patch is missing changes in one file. Here is it correct patch. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml index

RE: On login trigger: take three

2020-09-03 Thread tsunakawa.ta...@fujitsu.com
From: Konstantin Knizhnik > Recently I have asked once again by one of our customers about login trigger > in > postgres. People are migrating to Postgres from Oracle and looking for > Postgres > analog of this Oracle feature. > This topic is not new: > I attached my prototype implementation

Re: On login trigger: take three

2020-09-03 Thread Pavel Stehule
Hi čt 3. 9. 2020 v 15:43 odesílatel Konstantin Knizhnik < k.knizh...@postgrespro.ru> napsal: > Hi hackers, > > Recently I have asked once again by one of our customers about login > trigger in postgres. People are migrating to Postgres from Oracle and > looking for Postgres analog of this Oracle

On login trigger: take three

2020-09-03 Thread Konstantin Knizhnik
Hi hackers, Recently I have asked once again by one of our customers about login trigger in postgres. People are migrating to Postgres from Oracle and  looking for Postgres analog of this Oracle feature. This topic is not new:

<    1   2