dbTalk Databases Forums  

[BUGS] sequences problem

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] sequences problem in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default [BUGS] sequences problem - 05-19-2006 , 08:20 AM






Quote:
Could you provide a complete test case?
As I've been told, there is no special code, just a usual sequence usage. There is no small part of code that can be reproduced.
--
The situation is that there are 2 applications working with the same DB and accessing sequences. Each time application is started the sequences are reloaded (without doing this the sequences go crazy, e.g. you can get 1000 with 5 being the last value).
--
Quote:
Is it possible that another session is altering the sequence to
start with a lower value?
No, as only next value is called.

Have you perchance set the sequence's
Quote:
CACHE setting to a value other than 1 (one)?
No.

Quote:
What's the output of
"SELECT * FROM sequence_name"?
ERROR: relation "sequence_name" does not exist

Quote:
Are you making queries from more
than one session? Are you using connection pooling?
Yes. No.

Thank you.

On 4/7/06, Michael Fuhr <mike (AT) fuhr (DOT) org> wrote:
Quote:
On Thu, Apr 06, 2006 at 10:04:03AM +0000, Alex Fomin wrote:
While using the following function:
---
nextval(sequence_name) returns currval(sequence_name) -1
---
while +1 is expected. It happens only sometimes, no dependency can be found.

Could you provide a complete test case? That is, all SQL statements
that somebody could execute in an empty database to reproduce the
problem. It doesn't have to be 100% reproducible as long as it
does exhibit the behavior every once in a while (an indication of
how often or under what circumstances, if known, would be helpful).

Is it possible that another session is altering the sequence to
start with a lower value? Have you perchance set the sequence's
CACHE setting to a value other than 1 (one)? What's the output of
"SELECT * FROM sequence_name"? Are you making queries from more
than one session? Are you using connection pooling?

--
Michael Fuhr

--
Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer!
Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer


--


Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer!
Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] sequences problem - 05-19-2006 , 08:24 AM






gsmd (AT) gmx-topmail (DOT) de wrote:
Quote:
Could you provide a complete test case?
As I've been told, there is no special code, just a usual sequence
usage. There is no small part of code that can be reproduced.
How do you use tose sequences?

Quote:
The situation is that there are 2 applications working with the same
DB and accessing sequences. Each time application is started the
sequences are reloaded (without doing this the sequences go crazy,
e.g. you can get 1000 with 5 being the last value).
What do you mean by reloaded?

Quote:
What's the output of
"SELECT * FROM sequence_name"?
ERROR: relation "sequence_name" does not exist
Of course, you should have replaced "sequence_name" with the name of
your sequence.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.