Reading a table in a database from another database - Mailing list pgsql-general

From Steve SAUTETNER
Subject Reading a table in a database from another database
Date
Msg-id BKEHJDOFOAHJBCOBCHJGEEBDCDAA.ssa@informactis.com
Whole thread Raw
List pgsql-general
Hello !

I did exposed my problem, but i didn't expose it correctly :

I have 2 databases, here is the script :


\c template1
create database users;
\c users

create table users_info
    (
        id int4 primary key,
        name varchar(30),
        ...
    );

\c template1
create database products;
\c products

create table products_info
    (
        id int4 primary key,
        id_owner int4,
        lib varchar(30),
        unitprice numeric(13,2),
        ...
    );

I must define, in the database products, the products_info.id_owner
attribute as a foreign key of the attribute users_info.id in the database
users.

I can't merge the 2 databases. (These are very big, and much tables have the
same name).

Thanks for your help.


pgsql-general by date:

Previous
From: Christopher Zach
Date:
Subject: Re: Using oids for fast read-only access?
Next
From: "Tomáš Kubiš"
Date:
Subject: posix_getpwnam