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


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to