On Apr 26, 2005, at 2:58 PM, Tom Lane wrote:

... which indeed can be a feature, not a bug, depending on what you're
doing ...

Absolutely. An INSERT rule I have looks like this:

CREATE RULE insert_one AS
ON INSERT TO one WHERE NEW.id IS NULL
DO INSTEAD (
INSERT INTO _simple (id, guid, state, name, description)
VALUES (NEXTVAL('seq_kinetic'), NEW.guid, NEW.state, NEW.name, NEW.description);


  INSERT INTO simple_one (id, bool)
  VALUES (CURRVAL('seq_kinetic'), NEW.bool);
);

The call to NEXTVAL() in the first statement sets up a value I use in the second via CURRLVA().

Cheers,

David


---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to