Re: Trigger to run @ connection time?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kynn Jones" <kynnjo(at)gmail(dot)com>
Cc: "Alban Hertroys" <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>, "pgsql-general General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Trigger to run @ connection time?
Date: 2008-03-11 21:28:25
Message-ID: 6187.1205270905@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Kynn Jones" <kynnjo(at)gmail(dot)com> writes:
> If one can set up this insert operation so that it happens automatically
> whenever a new connection is made, I'd like to learn how it's done.

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?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Justin 2008-03-11 21:29:51 Re: simple UPDATE statement...
Previous Message Tom Lane 2008-03-11 21:25:00 Re: ERROR: text search configuration "pg_catalog.english" does not exist