From: | "Daniel Verite" <daniel(at)manitou-mail(dot)org> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Trigger to run @ connection time? |
Date: | 2008-03-13 10:59:57 |
Message-ID: | 2e819fe9-b070-4345-a958-2eec9ea13483@mm |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | vivek | 2008-03-13 11:47:01 | Generate schema like uml diagrams from existing db |
Previous Message | Kakoli Sen | 2008-03-13 10:52:28 | Re: Problem with GRANT in 7.4.19 |