Re: Double sequence increase on single insert with RULE on targeted table

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tomas Zerolo <tomas(at)tuxteam(dot)de>
Cc: Sarunas Krisciukaitis <sarunask(at)lonus-tech(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Double sequence increase on single insert with RULE on targeted table
Date: 2005-11-16 05:51:10
Message-ID: 20051116055110.GA59914@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Nov 16, 2005 at 06:29:40AM +0100, Tomas Zerolo wrote:
> AFAIK, serials are not guaranteed to produce sequential values; tehy
> will produce unique values. That means that they can (and sometimes
> will) jump.

In this particular case, however, the behavior is due to the rule
on test1:

CREATE RULE test1_on_insert AS ON INSERT TO test1
DO INSERT INTO test_log1 (qid) VALUES (new.id);

This "gotcha" comes up occasionally; it's due to the fact that rules
are macros. Search the archives for past discussion.

--
Michael Fuhr

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Zerolo 2005-11-16 06:02:27 Re: Double sequence increase on single insert with RULE on targeted table
Previous Message Tomas Zerolo 2005-11-16 05:29:40 Re: Double sequence increase on single insert with RULE on targeted table