Re: issue with SELECT settval(..); - Mailing list pgsql-general

From Alain Roger
Subject Re: issue with SELECT settval(..);
Date
Msg-id 75645bbb0703180318s153eb915sf74fe37fd928d54a@mail.gmail.com
Whole thread Raw
In response to Re: issue with SELECT settval(..);  (Christian Schröder <cs@deriva.de>)
List pgsql-general
thanks a lot Christian.

On 3/18/07, Christian Schröder <cs@deriva.de> wrote:
Alain Roger wrote:
> insert into immense.statususer (statususer_id, statususer_type) values
> (SELECT nextval( 'statususer_statususer_id_seq' ),'customer');
The correct syntax would be:

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

The sub-select must be put in parentheses. However, the much simpler
statement

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

will do the same without a sub-select.

Regards
    Christian

--
Deriva GmbH                         Tel.: +49 551 489500-42
Financial IT and Consulting         Fax:  +49 551 489500-91
Hans-Böckler-Straße 2                   http://www.deriva.de
D-37079 Göttingen

Deriva CA Certificate: http://www.deriva.de/deriva-ca.cer


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly



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

pgsql-general by date:

Previous
From: "Bruce McAlister"
Date:
Subject: Re: PostgreSQL 8.2.3 VACUUM Timings/Performance
Next
From: Stefan Berglund
Date:
Subject: Re: Is This A Set Based Solution?