Re: Sequence problems during restart

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: "'Masaru Sugawara'" <rk73(at)echna(dot)ne(dot)jp>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sequence problems during restart
Date: 2001-10-22 18:58:59
Message-ID: 017801c15b2b$9d80a660$8201a8c0@inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How does this fix my problem?

It appears like the sequence was generated properly, but possible not
written to disk at shutdown time.

There is some additional information here. We did an upgrade of glibc
just before the restart

Dave

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Masaru Sugawara
Sent: October 22, 2001 11:34 AM
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Sequence problems during restart

On Fri, 19 Oct 2001 13:15:38 -0400
"Dave Cramer" wrote:

> We have a number of tables which have unique id's generated from a
> sequence
>
> i.e. create table blat (id serial, ....)
>
> A number of these sequences seem to have been "set back" by 4 . In
> other words we have records for
>
> Id's 500, 501, 502, 503, and now the sequence is set to 500.
>

Hi,

How about using a CREATE SEQUENCE with a CYCLE option.

e.g.
create sequence seq_blat minvalue 500 maxvalue 503 cycle; create table
blat (id int4 default nextval('seq_blat'),
a varchar(10),
b varchar(10),
......
);

insert into blat (a, b, ...) values('aaa1', 'bbb1', .... ); insert
into blat (a, b, ...) values('aaa2', 'bbb2', .... ); insert into blat
(a, b, ...) values('aaa3', 'bbb3', .... ); ...

By the way, a mail server has been downed ?

Regards,
Masaru Sugawara

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Konstantinos Agouros 2001-10-22 19:29:53 Re: How to insert with a serial
Previous Message Mitch Vincent 2001-10-22 18:01:31 Re: How to insert with a serial