Reading a table in a database from another database

Поиск
Список
Период
Сортировка
Искать

Reading a table in a database from another database

От:
"Steve SAUTETNER" <ssa@informactis.com>
Дата:
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.

FAQ