Re: Subselects not allowed?
От | Leif Biberg Kristensen |
---|---|
Тема | Re: Subselects not allowed? |
Дата | |
Msg-id | 201106121022.28759.leif@solumslekt.org обсуждение исходный текст |
Ответ на | Re: Subselects not allowed? (Leif Biberg Kristensen <leif@solumslekt.org>) |
Ответы |
Re: Subselects not allowed?
Re: Subselects not allowed? |
Список | pgsql-sql |
On Saturday 11. June 2011 22.09.09 Leif Biberg Kristensen wrote: > I've written a blog post which I hope may be helpful to others in a similar > situation: > > <http://solumslekt.org/blog/?p=321> > > Thanks to Guillaume Lelarge, Tom Lane, and Andreas Kretschmer. You guys are > great. 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; regards, Leif http://code.google.com/p/yggdrasil-genealogy/
В списке pgsql-sql по дате отправления: