Re: sequence

Поиск
Список
Период
Сортировка
От Michael Schmidt
Тема Re: sequence
Дата
Msg-id BAYC1-PASMTP1247DFBB86BF2D9AC2323AA36B0@CEZ.ICE
обсуждение исходный текст
Ответ на Re: sequence  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Список pgsql-general
Another option is to set the default value of the field to the nextval,
such as for mytable primary key field
nextval(('public.users_user_id_seq'::text)::regclass).  Then, when you
write your SQL
INSERT INTO mytable VALUES(default).  I do it this way and find it a
little cleaner.  If you want to access the users_user_id_seq value
within the same transaction, then after the insert into mytable you can
use currval.

Michael Schmidt

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