issue with SELECT settval(..);

Поиск
Список
Период
Сортировка
От Alain Roger
Тема issue with SELECT settval(..);
Дата
Msg-id 75645bbb0703171219n44397d74n129789d515cf0423@mail.gmail.com
обсуждение исходный текст
Ответы Re: issue with SELECT settval(..);  (Christian Schröder <cs@deriva.de>)
Список pgsql-general
Hi,

I would like to auto increment my sequence when i'm going to insert a new record into my table.

for that i wanted to use :

insert into immense.statususer (statususer_id, statususer_type) values (SELECT nextval( 'statususer_statususer_id_seq' ),'customer');

however, i get an error message in pgAdmin III, as following :
ERROR:  syntax error at or near "SELECT" at character 168

i do not under because if I run SELECT nextval( 'statususer_statususer_id_seq' ) alone, it works perfectly and increment the sequence.
moreover, everything regarding the table is correct. so where is the problem ?

thanks a lot,

--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5

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

Предыдущее
От: Mageshwaran
Дата:
Сообщение: Postgres Database size
Следующее
От: Tom Lane
Дата:
Сообщение: Re: how can i show constraint checks in explain ?