Question about setval() function - Mailing list 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Use of OIDS as primary keys
Next
From: Erwin Ambrosch
Date:
Subject: Question about SERIAL