Re: updating a sequence - Mailing list pgsql-sql

From Jasen Betts
Subject Re: updating a sequence
Date
Msg-id ja10j4$gv$1@reversiblemaps.ath.cx
Whole thread Raw
In response to updating a sequence  (John Fabiani <johnf@jfcomputer.com>)
List pgsql-sql
On 2011-11-16, Scott Marlowe <scott.marlowe@gmail.com> wrote:

> You need to wrap a subselect in ():
>
> select setval('foo', (select max(some_id) from some_table));


I prefer to do it in once select like this:

select setval('foo', max(some_id)) from some_table;


-- 
⚂⚃ 100% natural



pgsql-sql by date:

Previous
From: John Fabiani
Date:
Subject: Re: updating a sequence
Next
From: Jasmin Dizdarevic
Date:
Subject: Change in 9.1?