sequence in select

From: "SunWuKung" <Balazs(dot)Klein(at)t-online(dot)hu>
To: pgsql-general(at)postgresql(dot)org
Subject: sequence in select
Date: 2006-06-22 14:10:38
Message-ID: 1150985438.469854.222130@i40g2000cwc.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I put the following into a function. Is this always going to give me a
sequence with an increment of 1 independently from other transactions?
If not what would be the standard way to return a sequence from a
query?

CREATE TEMPORARY SEQUENCE rank_seq;
SELECT nextval('rank_seq') FROM whatever ORDER BY id;
DROP SEQUENCE rank_seq;

thx.
Balázs

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alejandro Michelin Salomon ( Adinet ) 2006-06-22 14:37:58 Download pl/python
Previous Message Thomas Chille 2006-06-22 13:59:44 Re: simple query terminated by signal 11