triggers, rules and alter table

Started by Sergey Karinabout 20 years ago2 messagesgeneral
Jump to latest
#1Sergey Karin
sergey.karin@gmail.com

Hi, List!

I'm using pg 8.1.0

this version allows to create triggers on INSERT, DELETE and UPDATE and also
allows to create rules on SELECT, UPDATE, INSERT and DELETE.
But I want to do some actions on ALTER TABLE ... ADD COLUMN and ALTER TABLE
... DROP COLUMN events. How I can handle that events in 8.1.x version?

Sergey Karin

#2Richard Huxton
dev@archonet.com
In reply to: Sergey Karin (#1)
Re: triggers, rules and alter table

Sergey Karin wrote:

Hi, List!

I'm using pg 8.1.0

this version allows to create triggers on INSERT, DELETE and UPDATE and also
allows to create rules on SELECT, UPDATE, INSERT and DELETE.
But I want to do some actions on ALTER TABLE ... ADD COLUMN and ALTER TABLE
... DROP COLUMN events. How I can handle that events in 8.1.x version?

You can't. There aren't any hooks to attach triggers to for those actions.

Could you wrap your ALTER TABLE commands in a function?

--
Richard Huxton
Archonet Ltd