Thread: Re: [pgsql-bugs] Daily digest v1.1281 (14 messages)

Re: [pgsql-bugs] Daily digest v1.1281 (14 messages)

From
Josh Berkus
Date:
Michael, Ralph, etc.:

> Rules are macros, so when you refer to NEW.storage_id in the rule
> then the default expression "nextval('tmp_storage_id_seq')" is
> evaluated again. =C2=A0If you don't want that to happen then use a
> trigger.
>
> This comes up often -- maybe somebody could add it to the FAQ.

The reason it comes up often is that the "log" example is in our docs.   Si=
nce=20
it doesn't work as expected, I think we need to patch the docs.

Hmmmm ... would it be possible for the rule to call currval() instead of=20
NEW.id?

--=20
Josh Berkus
Aglio Database Solutions
San Francisco