Re: Question about setval() function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ambre(at)ebutec(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question about setval() function
Date: 2002-05-14 15:23:40
Message-ID: 26320.1021389820@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Erwin Ambrosch <ambre(at)ebutec(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2002-05-14 15:27:16 Re: Question about setval() function
Previous Message Martín Marqués 2002-05-14 15:23:14 Re: restoreing dumps fail