Re: sequence in schema -- broken default
От | Nigel J. Andrews |
---|---|
Тема | Re: sequence in schema -- broken default |
Дата | |
Msg-id | Pine.LNX.4.21.0401241224470.24965-100000@ponder.fairway2k.co.uk обсуждение исходный текст |
Ответ на | Re: sequence in schema -- broken default ("Joshua D. Drake" <jd@commandprompt.com>) |
Список | pgsql-general |
On Fri, 23 Jan 2004, Joshua D. Drake wrote: > > > CREATE DATABASE d; > > \c d > > > > CREATE SCHEMA one; > > SET search_path TO one; > > > > CREATE SEQUENCE foo_seq; > > CREATE TABLE foo( > > i integer > > DEFAULT nextval('foo_seq') > > ); > > > > > > SET search_path TO public; > > > > INSERT INTO foo VALUES (DEFAULT); > > > > > > > > The problem is that the DEFAULT nextval(... needs to qualify > > the sequence with the schema, but I am not sure how to > > determine the schema in my definition file. > > > I am not sure I exactly understand the above paragraph, but from yourexample > you are trying to insert into public.foo which does not exist. The value > would be > one.foo . > > insert into one.foo values(); I've a feeling that's what was meant in the original posting and that having done that the nextval on the default sequence fails because the sequence is not in the search_path. I seem to remember something like turning up sometime last year for me. I don't have a 7.4 or HEAD install to check against at the moment. -- Nigel J. Andrews
В списке pgsql-general по дате отправления: