Tagged Questions
3
votes
1answer
126 views
Check what event called the trigger on PostgreSQL?
I'm trying to check what event called my trigger, like INSERT, UPDATE or DELETE.
Oracle triggers can check this in a simple 'IF' statement:
IF INSERTING, IF UPDATING or even IF DELETING
Is there a ...
1
vote
1answer
262 views
Triggers not being run on a partitioned table
I'm using PostgreSQL. I have a table that I have partitioned into three sub-tables - and as far as I can tell, this all works correctly. Rows are correctly inserted into the appropriate partition and ...
6
votes
2answers
2k views
Trigger: move deleted rows to archive table
I have a small (~10 rows) table called restrictions in my PostgreSQL database, where values are deleted and inserted on a daily basis.
I would like to have a table called restrictions_deleted, where ...
17
votes
1answer
1k views
Is there a good way to run a trigger for each record in a postgres table?
I have a system where I can't control the design of some tables (replicated via Slony-I), and so I have a series of what we refer to as 'shadow tables', where I extract some information out of the ...