Re: Trigger to run @ connection time?

Поиск
Список
Период
Сортировка
Искать
От
Robert Treat
Тема
Re: Trigger to run @ connection time?
Дата
Msg-id
200803161712.17964.xzilla@users.sourceforge.net
Ответ на
Список
Дерево обсуждения
Trigger to run @ connection time? "Kynn Jones" <kynnjo@gmail.com>
Re: Trigger to run @ connection time? Alban Hertroys <dalroi@solfertje.student.utwente.nl>
Re: Trigger to run @ connection time? "Kynn Jones" <kynnjo@gmail.com>
Re: Trigger to run @ connection time? Tom Lane <tgl@sss.pgh.pa.us>
Re: Trigger to run @ connection time? "Daniel Verite" <daniel@manitou-mail.org>
Re: Trigger to run @ connection time? "Dawid Kuroczko" <qnex42@gmail.com>
Re: Trigger to run @ connection time? "Marko Kreen" <markokr@gmail.com>
Re: Trigger to run @ connection time? "Dawid Kuroczko" <qnex42@gmail.com>
Re: Trigger to run @ connection time? "Marko Kreen" <markokr@gmail.com>
Re: Trigger to run @ connection time? Erik Jones <erik@myemma.com>
Re: Trigger to run @ connection time? "Marko Kreen" <markokr@gmail.com>
Re: Trigger to run @ connection time? Robert Treat <xzilla@users.sourceforge.net>
Re: Trigger to run @ connection time? Erik Jones <erik@myemma.com>
Re: Trigger to run @ connection time? "Kynn Jones" <kynnjo@gmail.com>
Re: Trigger to run @ connection time? Karsten Hilbert <Karsten.Hilbert@gmx.net>
Re: Trigger to run @ connection time? btober@ct.metrocast.net
Re: Trigger to run @ connection time? Alban Hertroys <dalroi@solfertje.student.utwente.nl>
Re: Trigger to run @ connection time? Berend Tober <btober@ct.metrocast.net>
Re: Trigger to run @ connection time? Alban Hertroys <dalroi@solfertje.student.utwente.nl>
Re: Trigger to run @ connection time? "Andrej Ricnik-Bay" <andrej.groups@gmail.com>
Re: Trigger to run @ connection time? "Kynn Jones" <kynnjo@gmail.com>
Re: Trigger to run @ connection time? "Greg Sabino Mullane" <greg@turnstep.com>
On Friday 14 March 2008 11:36, Marko Kreen wrote:
> On 3/14/08, Erik Jones  wrote:
> >  On Mar 14, 2008, at 7:17 AM, Marko Kreen wrote:
> >  > To put it to core Postgres, it needs to be conceptually sane
> >  > first, without needing ugly workarounds to avoid it bringing
> >  > whole db down.
> >  >
> >  > I can see ATM only few ways:
> >  >
> >  > - Applies only to non-superusers.
> >  >
> >  > - Error from CONNECT trigger does not affect superuser.
> >  >
> >  > - Applies to database + role.  Role could be also group of users.
> >  >
> >  > So you always have way do fix things, without hexediting in data
> >  > dir...
> >
> > Another option:
> >
> >  Does not fire at all in single-user mode.  This would be covered by
> >  "Applies to non-superusers" if that were there but, by itself, the
> >  triggers would still fire for normal superuser connections.
>
> Seems bit too hard - you may other db-s that work fine,
> why should those suffer?
>

there are other failure scenario's for a single db that require single user 
mode (think corrupted indexes), so I'm not sure that is too high a price to 
be paid, though a less barriar would be better.

If we decide that an on connect trigger involves the combination of a database 
and a role, you generally can escape from the failure scenario by having 
either a different role, or a different database with the ability to 
do "alter database disable on connect triggers". whether this is a direct 
alter database, or set at the GUC level, either makes it pretty hard to lock 
yourself out completly, and single user mode can be the fall back for that if 
needed. 

-- 
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL
В списке pgsql-general по дате отправления
От: Kynn Jones
Дата:
От: Tom Lane
Дата:
FAQ