Re: creating a table with a serial column sets currval

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: creating a table with a serial column sets currval
Дата
Msg-id Pine.BSO.4.64.0710181622170.12647@leary.csoft.net
обсуждение исходный текст
Ответ на creating a table with a serial column sets currval  (Kris Jurka <books@ejurka.com>)
Ответы Re: creating a table with a serial column sets currval
Список pgsql-bugs
On Thu, 18 Oct 2007, Kris Jurka wrote:

>
> jurka=# create table t (c serial);
> NOTICE:  CREATE TABLE will create implicit sequence "t_c_seq" for serial
> column "t.c"
> CREATE TABLE
> jurka=# select currval('t_c_seq');
> currval
> ---------
>       1
> (1 row)
>
> I would expect it to say that currval wasn't set like so:
>

Looks like any alter sequence command will do this.  The serial case uses
alter sequence owned by under the hood which exposes this.  The problem is
that altering the sequence puts it into the SeqTable cache list when it
really shouldn't be.

Kris Jurka

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: creating a table with a serial column sets currval
Следующее
От: Tom Lane
Дата:
Сообщение: Re: creating a table with a serial column sets currval