insert into / select from / serial problem

Поиск
Список
Период
Сортировка
От tgh002
Тема insert into / select from / serial problem
Дата
Msg-id 1123643026.939110.310310@g47g2000cwa.googlegroups.com
обсуждение исходный текст
Ответы Re: insert into / select from / serial problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: insert into / select from / serial problem  (PFC <lists@boutiquenumerique.com>)
Список pgsql-sql
I am using a insert statement like:

INSERT INTO newtable
SELECT field1, field2 FROM anothertable

newtable structure is: serial, varchar, varchar

What syntax do I use to insert the serial field?   Ive tried something
like:
INSERT INTO newtable
SELECT nextval('newtable_id_seq'), field1, field2 FROM anothertable
but that doesnt work

Any ideas?  Greatly appreciated!



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

Предыдущее
От: Jeff Lu
Дата:
Сообщение: How to encrypt a column
Следующее
От: "Akshay Mathur"
Дата:
Сообщение: sql function: using set as argument