Re: Question about setval() function - Mailing list pgsql-general

From Tom Lane
Subject Re: Question about setval() function
Date
Msg-id 26320.1021389820@sss.pgh.pa.us
Whole thread Raw
In response to Question about setval() function  (Erwin Ambrosch <ambre@ebutec.com>)
List pgsql-general
Erwin Ambrosch <ambre@ebutec.com> writes:
> the following doesn't work.

> SELECT setval('int_article_id_seq', SELECT max(id) FROM int_article);

You've got the syntax wrong: subselects must be parenthesized.

SELECT setval('int_article_id_seq', (SELECT max(id) FROM int_article));

            regards, tom lane

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Strange interaction with php's pg_query
Next
From: Scott Marlowe
Date:
Subject: Re: Quotes in SQL