Question about setval() function

From: Erwin Ambrosch <ambre(at)ebutec(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Question about setval() function
Date: 2002-05-14 14:18:47
Message-ID: 200205141322.g4EDMpQ09724@email.ebutec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

the following doesn't work.

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

I also tried to cast in the second argument, but with no success.

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

Is this not possible at all or do I anything wrong.

Tanks Erwin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Abbate 2002-05-14 14:21:37 Re: transitioning postgres oid
Previous Message Tom Lane 2002-05-14 14:16:34 Re: Use of OIDS as primary keys