temp sequence

Поиск
Список
Период
Сортировка
Искать
От
Sim Zacks
Тема
temp sequence
Дата
Msg-id
fo3nnb$cfd$1@news.hub.org
Список
Дерево обсуждения
temp sequence Sim Zacks <sim@compulab.co.il>
Re: temp sequence Adrian Klaver <aklaver@comcast.net>
Re: temp sequence Raymond O'Donnell <rod@iol.ie>
Re: temp sequence "Jaime Casanova" <systemguards@gmail.com>
"PostgreSQL 8.2.4 on i386-pc-linux-gnu, compiled by GCC i386-pc-linux-gnu-gcc 
(GCC) 4.1.1 (Gentoo 4.1.1)"

I am creating a temporary sequence in a function and it seems like it is not 
going away after the function finishes.
The front end is in MS Access 2000 and I have a single connection. When I call 
the function once it works, when I call it a second time, it gives me an error 
that the sequence already exists. When I restart the application, I can call the 
function again.

I solved the problem by using: alter sequence seq_linenum restart with 1;

The manual states:
If specified, the sequence object is created only for this session, and is 
automatically dropped on session exit. Existing permanent sequences with the 
same name are not visible (in this session) while the temporary sequence exists, 
unless they are referenced with schema-qualified names.

I thought that a function would be considered its own session, is that incorrect?

Thank you
Sim
В списке pgsql-general по дате отправления
От: jiniusatwork-postgresql@yahoo.com
Дата:
От: Jaime Casanova
Дата:
Сообщение: Re: temp sequence
FAQ