Re: Locking of auto generated sequence

Поиск
Список
Период
Сортировка
От sid tow
Тема Re: Locking of auto generated sequence
Дата
Msg-id 20050201135543.9793.qmail@web42105.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: Locking of auto generated sequence  (Richard Huxton <dev@archonet.com>)
Ответы Re: Locking of auto generated sequence  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
I am using a 7.2 version of postgreSQL and here if I have to copy data in a particular table then I cannot specify the columns I want to update, but rather i will have to copy data into all the columns present. Now the problem is that I have a auto generated sequence starting from 1 in one of the columns. If I try to copy the data into this column (numerically incrementing numbers ie same as the auto seq) also then i cannot get the last value of the sequence number which I can get by
select last_value from seq;.
     But if I insert data in the columns other than this one then the sequence auto increments and I get the value in my next run. Can you tell me why is it happening this way and is there any solution so that i use only copy commands to update the data.

Richard Huxton <dev@archonet.com> wrote:
sid tow wrote:
> Hi All,
>
> Is there a way to stop a auto generated sequence from incrementing
> for some time and then activate it to do the increments.

You might be able to do something by revoking permissions to the
sequence, and wrapping nextval/currval with security=owner functions. If
you can describe what you're trying to achieve and why that might help.

--
Richard Huxton
Archonet Ltd


Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.

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

Предыдущее
От: Geoffrey
Дата:
Сообщение: Re: PostgreSQL Security Release
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: PostgreSQL Security Release