Re: On login trigger: take three

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: Greg Nancarrow <gregn4422(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: On login trigger: take three
Date: 2020-12-04 10:05:45
Message-ID: 6fc3d3b2-7c4f-4ab6-446d-4c3579b148f5@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04.12.2020 3:50, Greg Nancarrow wrote:
> On Tue, Sep 15, 2020 at 2:12 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> 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 unpleasant surprise, and my question is if it can be fixed. Creating custom libpq variables can be the stop for people that use pgAdmin.
>>
> Hi,
>
> I thought in the case of using pgAdmin (assuming you can connect as
> superuser to a database, say the default "postgres" maintenance
> database, that doesn't have an EVENT TRIGGER defined for the
> session_start event) you could issue the query "ALTER SYSTEM SET
> disable_session_start_trigger TO true;" and then reload the
> configuration?
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 disable_session_start_trigger=true'" in connection
string.
I do not know if it can be done with pgAdmin.
>
> Anyway, I am wondering if this patch is still being actively developed/improved?

I do not know what else has to be improved.
If you, Pavel or anybody else have some suggestions: please let me know.
>
> Regarding the last-posted patch, I'd like to give some feedback. I
> found that the documentation part wouldn't build because of errors in
> the SGML tags. There are some grammatical errors too, and some minor
> inconsistencies with the current documentation, and some descriptions
> could be improved. I think that a colon separator should be added to
> the NOTICE message for superuser, so it's clear exactly where the text
> of the underlying error message starts. Also, I think that
> "client_connection" is perhaps a better and more intuitive event name
> than "session_start", or the suggested "user_backend_start".
> I've therefore attached an updated patch with these suggested minor
> improvements, please take a look and see what you think (please
> compare with the original patch).

Thank you very much for detecting the problems and much more thanks for
fixing them and providing your version of the patch.
I have nothing against renaming "session_start" to "client_connection".

--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2020-12-04 10:09:13 Re: pg_stat_statements oddity with track = all
Previous Message hou zhijie 2020-12-04 09:29:01 Re: A new function to wait for the backend exit after termination