I've got a table, and I'm trying to track changes to it, but can't do it via a
primary key including a revision-number (historical reasons).
CREATE TABLE foo (
id SERIAL,
blah text,
tracking int4 DEFAULT currval('foo_id_seq')
PRIMARY KEY (id)
);
I'm actually setting the DEFAULT on tracking using ALTER TABLE after the
event.
Now - it works, but is that a design feature or just luck?
It's convenient that tracking = id of the first entry, but not vital, so I can
always use a separate sequence if needs be.
--
Richard Huxton
Archonet Ltd