Re: sequence in schema -- broken default - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: sequence in schema -- broken default
Date
Msg-id 40114CB5.2080603@commandprompt.com
Whole thread Raw
In response to sequence in schema -- broken default  ("Lee Harr" <missive@hotmail.com>)
Responses Re: sequence in schema -- broken default  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
List pgsql-general
> 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();

Sincerely,

Joshua D. Drake



>
> Any hints?
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings



--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL


pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: psql: relocation error: psql: undefined symbol: PQgetssl
Next
From: Dennis Haney
Date:
Subject: Re: Recursive optimization of IN subqueries