Re: Subselects not allowed? - Mailing list pgsql-sql

From Florian Weimer
Subject Re: Subselects not allowed?
Date
Msg-id 82pqmgwm0u.fsf@mid.bfk.de
Whole thread Raw
In response to Re: Subselects not allowed?  (Leif Biberg Kristensen <leif@solumslekt.org>)
List pgsql-sql
* Leif Biberg Kristensen:

> And even better, in the first comment to the blog post, I was advised about the
> SETVAL() function which does exactly what I wanted in the first place.
>
> CREATE SEQUENCE persons_person_id_seq;
> SELECT SETVAL('persons_person_id_seq', MAX(person_id)) FROM persons;
> ALTER TABLE persons ALTER COLUMN person_id SET DEFAULT
> NEXTVAL('persons_person_id_seq');
> ALTER SEQUENCE persons_person_id_seq OWNED BY persons.person_id;

I think you should acquire an exclusive lock on the table, too.

--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99


pgsql-sql by date:

Previous
From: Tarlika Elisabeth Schmitz
Date:
Subject: extract some column/value pairs via hstore
Next
From: INDER
Date:
Subject: Storage of Indian Language text in postgresql through PHP