Re: Truncate Triggers

Поиск
Список
Период
Сортировка
От Decibel!
Тема Re: Truncate Triggers
Дата
Msg-id 20080202041648.GP1212@decibel.org
обсуждение исходный текст
Ответ на Re: Truncate Triggers  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-hackers
On Thu, Jan 31, 2008 at 11:45:55AM +0000, Simon Riggs wrote:
> On Thu, 2008-01-31 at 10:22 +0000, Gregory Stark wrote:
> > "Decibel!" <decibel@decibel.org> writes:
> >
> > > CLUSTER isn't DDL. Most forms of ALTER TABLE are. And CREATE blah, etc.
> >
> > Fwiw I would call CLUSTER DDL. Note that it does make a change that's visible
> > in the table definition afterwards.
> >
> > There are plenty of DDL commands which modify data (CREATE INDEX, ATLER TABLE
> > ALTER COLUMN TYPE). The defining characteristic of DDL is not that it doesn't
> > modify the data but that it does modify the table definition.
> >
> > By that definition CLUSTER is DDL and TRUNCATE is DDL if you look at the
> > implementation rather than the user-visible effects.
>
> Surely the question is more simple: do we want triggers on it?
>
> There's a clear case for TRUNCATE to have a triggers.
>
> Is there a clear case for any other statements (however you categorise
> them)? If so, lets hear it, please.

Having "triggers" on ALTER table means that replication systems can
replicate changes automatically.

Having triggers on CREATE, ALTER, DROP mean that you can audit DDL, or
if desired prevent it.

Searching the mailing lists for "ddl trigger" for the last year turns up
87 hits. This is something that a lot of people have been asking for.
--
Decibel!, aka Jim C. Nasby, Database Architect  decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Gurjeet Singh"
Дата:
Сообщение: Re: and waiting
Следующее
От: "Omar Bettin"
Дата:
Сообщение: Strange behavior on plpgsql trigger function in if comparison