Re: partitioning / rules - strange behavior

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: partitioning / rules - strange behavior
Date: 2007-02-07 22:02:07
Message-ID: 20070207220207.GC25868@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message rob_spellberg 2007-02-07 22:12:20 a request for the 8.1.7 and 8.2.2 tarballs and the good reasons why
Previous Message Michael Guerin 2007-02-07 21:56:01 Re: Database corruption.