Re: [SQL] Rules and sequences

2010-05-27 Thread Ben Morrow
Quoth t...@sss.pgh.pa.us (Tom Lane): > Ben Morrow writes: > > I am trying to implement a fairly standard 'audit table' setup, but > > using rules instead of triggers (since it should be more efficient). > > Rules are sufficiently tricky that I would never, ever rely on them for > auditing. Use a

Re: [SQL] Rules and sequences

2010-05-26 Thread A. Kretschmer
In response to Tom Lane : > Ben Morrow writes: > > I am trying to implement a fairly standard 'audit table' setup, but > > using rules instead of triggers (since it should be more efficient). > > Rules are sufficiently tricky that I would never, ever rely on them for > auditing. Use a simple AFT

Re: [SQL] Rules and sequences

2010-05-26 Thread Tom Lane
Ben Morrow writes: > I am trying to implement a fairly standard 'audit table' setup, but > using rules instead of triggers (since it should be more efficient). Rules are sufficiently tricky that I would never, ever rely on them for auditing. Use a simple AFTER trigger instead.

[SQL] Rules and sequences

2010-05-26 Thread Ben Morrow
I am trying to implement a fairly standard 'audit table' setup, but using rules instead of triggers (since it should be more efficient). However, I'm running into problems when one of the audited tables has a 'serial' column that is allowed to default: create table foo (id serial, bar text);