sequence help

Поиск
Список
Период
Сортировка
От Matthew Peter
Тема sequence help
Дата
Msg-id 466751.40626.qm@web35203.mail.mud.yahoo.com
обсуждение исходный текст
Ответы Re: sequence help
Re: sequence help
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Why overlaps is not working
Следующее
От: "Greg Peters"
Дата:
Сообщение: Problem with unique key