On Wed, Jan 02, 2002 at 12:16:14PM -0500, Tom Lane wrote:
Hey, I got an SQL feature for you: One could use those generalized
deferred triggers to implement:
CREATE TEMP TABLE <table> ( ... ) ON COMMIT DELETE ROWS
Simply add a not deferred trigger on insertion to <table>, which
checks if it was already called in the same transaction (using a
hard-coded transaction id as static variable) and if not, adds a
generalized clean-up trigger which truncates <table>. (Shall triggers
ON DELETE for <table> be called in this case or not ?)
--
Holger Krug
hkrug@rationalizer.com