Re: Trigger to run @ connection time?
От | Daniel Verite |
---|---|
Тема | Re: Trigger to run @ connection time? |
Дата | |
Msg-id | 2e819fe9-b070-4345-a958-2eec9ea13483@mm обсуждение исходный текст |
Ответ на | Re: Trigger to run @ connection time? (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-general |
Tom Lane wrote: > For manual psql sessions, you can put some setup commands in ~/.psqlrc. > In any other context I'm afraid you're stuck with modifying your client > application code. > > An ON CONNECT trigger enforced by the database seems a bit scary to me. > If it's broken, how you gonna get into the DB to fix it? At the protocol level, when the opening of a new session is requested, how about a "skip connect-trigger" run-time parameter? This parameter would be ignored (or an error being raised) if the connect isn't issued by the owner of the database or a superuser. Within client applications, the functionality could then be implemented at the same level than the other connection parameters, I'm thinking of a checkbox in a GUI or an additional parameter to the \connect psql command. By comparison, Oracle's solution to this is a grantable privilege that causes their "logon triggers" to ignore any error. -- Daniel PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org
В списке pgsql-general по дате отправления: