Re: Sequence skipping values - Mailing list pgsql-general

From Jean-Christophe Roux
Subject Re: Sequence skipping values
Date
Msg-id 20060211140621.61693.qmail@web35312.mail.mud.yahoo.com
Whole thread Raw
In response to Re: Sequence skipping values  (Michael Fuhr <mike@fuhr.org>)
Responses Re: Sequence skipping values  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Hi Michael,

I'm running PostgreSQL 7.4.5 on a shared wehosting, which means among other things that I have limited control over the database settings and capabilities, For instance, I cannot install languages and therefore I cannot write triggers.

Yes you are right, I did not show one rule on table topics:
CREATE OR REPLACE RULE topics_last_administrator_id AS
    ON INSERT TO topics DO  UPDATE topics SET last_administrator_id = new.administrator_id
  WHERE topics.topic_id = new.topic_id;

I am going to try to replicate the problem, using a local 8.1.2 database.

Thank you very much for your help
JCR

Michael Fuhr <mike@fuhr.org> wrote:
On Fri, Feb 10, 2006 at 08:10:36PM -0800, Jean-Christophe Roux wrote:
> here are the structures of the table involved:

I co uldn't duplicate the problem in 8.1.2 or 8.0.6 with the code
you posted. I created the given tables and rules (plus guesses for
the administrators and status_list tables), then inserted several
records into topics, then inserted a few records into releases,
then inserted a few more records into topics. The topics_id_seq
sequence incremented by one each time with no gaps; that probably
means my test didn't match exactly what you're doing.

Does the topics table have any rules or triggers that you didn't
show? Could you post a minimal but complete test case, i.e, all
SQL statements that somebody could load into an empty database to
reproduce the problem? If not then it might be useful to see the
EXPLAIN ANALYZE output of a series of statements that exhibit the
unexpected behavior. What version of PostgreSQL are you running?

--
Michael Fuhr


Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.

pgsql-general by date:

Previous
From: Pandurangan R S
Date:
Subject: Re:
Next
From: "Jim Buttafuoco"
Date:
Subject: Re: Adding pl/perl support