Search Postgresql Archives

sequence help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'll jump right in with an example

create sequence foo start with 1;

create view foobar as select *, nextval('foo') from bar;

The problem is I need a nextval()-like method that returns the iterations without
updating the foo sequence. Therefore, maintaining the sequences original value by
starting at 1 each time the foobar VIEW is invoked. 

This is obviously a simplified example for an larger query dependent on row order
integrity in a view.

On http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html I did not
find any way to avoid updating sequences (albeit they are supposed to update by
design and may need to update in order to pull the next in sequence). Nor was I able
to maintain iteration in a nextval()-like function. Any ideas?

Matt


 
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux