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. ÂIf 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.   Since 
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 
NEW.id?

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to