Re: Triggers on system catalog

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Christopher Browne <cbbrowne(at)gmail(dot)com>, Shridhar Polas <shridharpolas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Triggers on system catalog
Date: 2011-03-30 20:45:10
Message-ID: 4D939656.6020903@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/30/2011 9:49 AM, Robert Haas wrote:
> On Tue, Mar 29, 2011 at 9:40 PM, Stephen Frost<sfrost(at)snowman(dot)net> wrote:
>> * Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
>>> I do think we need some kind way of capturing DDL events, though. I wonder if the object-access-hook stuff KaiGai and I did to support SE-PostgreSQL could be extended to meet this need...
>>
>> My inclination would be 'probably', but it's not likely to really be the
>> way we'd want to provide generalized DDL triggers..
>
> I guess I was imagining that DDL triggers would be primarily important
> for things like Slony, that are already writing C code anyway, but
> maybe that's overly optimistic...
>

Slony is using C code in every performance critical path. Other than
that, we are perfectly happy with PL/pgSQL code.

What I would envision for DDL triggers is that they first don't fire on
an object type, but rather on a command completion code, like "CREATE
TABLE" or "DROP SCHEMA".

To do anything useful with that of course would require that all DDL
does go through tcop's ProcessUtility and actually synthesizes a proper
Utility parsetree. That isn't the case today, so there would be some
previous clean up work to be done.

Jan

--
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-03-30 20:46:00 Re: Problem with pg_upgrade?
Previous Message Selena Deckelmann 2011-03-30 20:42:16 Re: proposal: a validator for configuration files