issue with SELECT settval(..);

From: "Alain Roger" <raf(dot)news(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: issue with SELECT settval(..);
Date: 2007-03-17 19:19:53
Message-ID: 75645bbb0703171219n44397d74n129789d515cf0423@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-03-17 19:43:32 Re: how can i show constraint checks in explain ?
Previous Message Mageshwaran 2007-03-17 19:10:23 Postgres Database size