Re: Truncate Triggers
От | David Fetter |
---|---|
Тема | Re: Truncate Triggers |
Дата | |
Msg-id | 20080202222652.GG4153@fetter.org обсуждение исходный текст |
Ответ на | Re: Truncate Triggers ("Christopher Browne" <cbbrowne@gmail.com>) |
Ответы |
Re: Truncate Triggers
|
Список | pgsql-hackers |
On Sat, Feb 02, 2008 at 05:23:39PM -0500, Christopher Browne wrote: > On Feb 2, 2008 2:43 PM, David Fetter <david@fetter.org> wrote: > > It still involves DDL-like operations in the sense of changing > > (for the duration of the query) trigger behavior. > > But that "change of trigger behavior" is still more in the "DML" > sense than "DDL sense." > > The point of TRUNCATE is that we have an optimization that's > superior (in some important senses) to "DELETE FROM." > > The differences between TRUNCATE FOO and DELETE FROM FOO do not have > to do with the one altering the schema for the table. The schema > remains the same. In essence, the schema changes for the duration of the TRUNCATE. Any data integrity constraints that triggers used are therefore violated, and it's DDL-like. To put it another way, if you want to duplicate the trigger-suppression behavior, you have to issue DDL. > I think it would be nice to be able to have more "trigger hooks" > relating to DDL changes, but I also think that will represent some > fundamentally more difficult problems being raised than is the case > for a TRUNCATE trigger. Are they really? Cheers, David. -- David Fetter <david@fetter.org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate
В списке pgsql-hackers по дате отправления: