Trigger on transaction? - Mailing list pgsql-general

From sixtus@gmail.com
Subject Trigger on transaction?
Date
Msg-id a3229be00704131529i6e88889n6cce6d31f80334b6@mail.gmail.com
Whole thread Raw
List pgsql-general
Hello all,


I've been enjoying programming postgres for a while, but I am stuck
with a problem neither the excellent documentation nor the search on
this mailing list provides with a solution.

It's been asked before, I too would like to have a trigger on transaction!

Use cases:

- I want to version a table which sees multiple updates during one
transaction, but I only need transaction resolution. My solution would
be a trigger on insert/update to copy into a temporary table (where
multiple updates overwrite the old value) and on commit copy into the
version table.

- I would like to have transient data within a persistent table. While
I am in the transaction, the transient information is available, on
commit it is deleted. The only other solution I can think of is a
temporary table inheriting my persistent table. Is that doable? How do
I move a row from parent to child table, will that value drop when the
transaction ends?


Any help greatly appreciated!

Regards,

Hagen

pgsql-general by date:

Previous
From: Rajarshi Guha
Date:
Subject: indexing array columns
Next
From: "Anton Melser"
Date:
Subject: recommendations for reducing mem usage on local dev machine