Re: partitioning / rules - strange behavior - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: partitioning / rules - strange behavior
Date
Msg-id 20070207220207.GC25868@svana.org
Whole thread Raw
In response to Re: partitioning / rules - strange behavior  (Tomas Vondra <tv@fuzzy.cz>)
Responses Re: partitioning / rules - strange behavior  (Tomas Vondra <tv@fuzzy.cz>)
List pgsql-general
On Wed, Feb 07, 2007 at 08:09:57PM +0100, Tomas Vondra wrote:
> But I don't understand why the nextval('sessions_id_seq') is evaluated
> multiple times? Even when I do

RULE expand like macros, so every expression passed in is simply copied
to each place, leading to multiple evaluations.

If you've played with the C preprocessor: that has the same basic
problem.

It's rather unexpected for novices, which is why triggers are usually
recommended.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Michael Guerin
Date:
Subject: Re: Database corruption.
Next
From: rob_spellberg
Date:
Subject: a request for the 8.1.7 and 8.2.2 tarballs and the good reasons why