[GENERAL] access public relation from a private database

2008-09-29 Thread Joey K.
Hello,

I've created a table in public schema,
CREATE TABLE public.foo (fooid SERIAL);


When I try to create a table in database nowhere that references public.foo
table,

CREATE DATABASE nowhere;
\c nowhere;
CREATE TABLE bar (bar integer REFERENCES public.foo(fooid));

I get, ERROR:  relation public.foo does not exist.

Can I reference public relations from private database?

Thanks,
Steve


Re: [GENERAL] access public relation from a private database

2008-09-29 Thread Tino Wildenhain

Joey K. wrote:


Hello,

I've created a table in public schema,
CREATE TABLE public.foo (fooid SERIAL);


When I try to create a table in database nowhere that references 
public.foo table,


CREATE DATABASE nowhere;
\c nowhere;
CREATE TABLE bar (bar integer REFERENCES public.foo(fooid));

I get, ERROR:  relation public.foo does not exist.

Can I reference public relations from private database?


You cannot. But you can create a private schema along
the public one above in the same database.

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [GENERAL] access public relation from a private database

2008-09-29 Thread A. Kretschmer
am  Mon, dem 29.09.2008, um 17:43:21 +0530 mailte Joey K. folgendes:
 
 When I try to create a table in database nowhere that references public.foo
 table,
 
 CREATE DATABASE nowhere;
 \c nowhere;
 CREATE TABLE bar (bar integer REFERENCES public.foo(fooid));
 
 I get, ERROR:  relation public.foo does not exist.
 
 Can I reference public relations from private database?

You can't access across databases.


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: - Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general