Re: Bug with sequences and WAL ? - Mailing list pgsql-general

From Tom Lane
Subject Re: Bug with sequences and WAL ?
Date
Msg-id 15339.1139020693@sss.pgh.pa.us
Whole thread Raw
In response to Bug with sequences and WAL ?  (Philippe Ferreira <phil.f@worldonline.fr>)
Responses Re: Bug with sequences and WAL ?  (Philippe Ferreira <phil.f@worldonline.fr>)
Re: Bug with sequences and WAL ?  (Philippe Ferreira <phil.f@worldonline.fr>)
List pgsql-general
Philippe Ferreira <phil.f@worldonline.fr> writes:
> If a new sequence is created, its creation is propagated via WAL.

> However, instead of getting the property 'is_called'=false (the correct
> value before its first use),
> we get 'is_called'=true after a PITR recovery.

> Is it a bug, or a normal behaviour ?

I don't think this is very important, because the normal behavior of
sequences is that after a crash the sequence can be up to 32 (IIRC)
counts beyond the last value actually delivered before the crash.
To get "exact" restart behavior we'd need to emit a separate xlog
record for each nextval() command, which seems like a pretty high
price considering that you cannot assume no holes in the sequence
values anyway.

            regards, tom lane

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Error with temporary tables
Next
From: Tyler MacDonald
Date:
Subject: Should I use PL/PGSQL or Perl/PGSQL?