Re: Question about setval() function

From: "Tom Pfau" <T(dot)Pfau(at)emCrit(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question about setval() function
Date: 2002-05-14 16:36:51
Message-ID: 5C47691674725C47B02996F02C0D362107B683@exchange.rane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----Original Message-----
From: Erwin Ambrosch [mailto:ambre(at)ebutec(dot)com]
Sent: Tuesday, May 14, 2002 10:19 AM
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] Question about setval() function

> the following doesn't work.

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

Try this instead:

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

Browse pgsql-general by date

  From Date Subject
Next Message Philip Hallstrom 2002-05-14 16:37:07 Re: Question about SERIAL
Previous Message Joel Burton 2002-05-14 16:24:48 Re: Using COPY