Re: Trigger to run @ connection time? - Mailing list pgsql-general

From Daniel Verite
Subject Re: Trigger to run @ connection time?
Date
Msg-id 2e819fe9-b070-4345-a958-2eec9ea13483@mm
Whole thread Raw
In response to Re: Trigger to run @ connection time?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Problem with GRANT in 7.4.19
Next
From: Alvaro Herrera
Date:
Subject: pgfoundry is down