Re: issue with SELECT settval(..);
От | Alain Roger |
---|---|
Тема | Re: issue with SELECT settval(..); |
Дата | |
Msg-id | 75645bbb0703180318s153eb915sf74fe37fd928d54a@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: issue with SELECT settval(..); (Christian Schröder <cs@deriva.de>) |
Список | pgsql-general |
thanks a lot Christian.
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5
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 по дате отправления: