By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,710 Members | 1,970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,710 IT Pros & Developers. It's quick & easy.

Accessing tables from different databases

P: n/a
Hi all,
I want to access a table-1 of database-1 from
database-2. Is it possible in pgsql. If so,
is it possible to define a foreign key constraint
for a column in table-2 in database-2 which
references to a column in table-1 in database-1.
TIA

regards,
Deepa K.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 11 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
K. Deepa wrote:
Hi all,
I want to access a table-1 of database-1 from
database-2. Is it possible in pgsql. If so,
Yes. You need to use dblink contrib module for that.
is it possible to define a foreign key constraint
for a column in table-2 in database-2 which
references to a column in table-1 in database-1.


I am afraid that's not possible.

Shridhar
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #2

P: n/a
Look at contrib/dblink.

Regards.

Fernando.
En un mensaje anterior, K. Deepa escribió:
Hi all,
I want to access a table-1 of database-1 from
database-2. Is it possible in pgsql. If so,
is it possible to define a foreign key constraint
for a column in table-2 in database-2 which
references to a column in table-1 in database-1.
TIA


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #3

P: n/a
Fernando Schapachnik <fe******@mecon.gov.ar> writes:
En un mensaje anterior, K. Deepa escribió:
I want to access a table-1 of database-1 from
database-2. Is it possible in pgsql. If so,
Look at contrib/dblink.


Also consider the possibility of using multiple schemas in a single
database, rather than a multi-database installation.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #4

P: n/a
Hello,

You can acces others db via dblink. You will find it in contrib.
You can't use dblink for define f.k. :-(

regars
Pavel

Hi all,
I want to access a table-1 of database-1 from
database-2. Is it possible in pgsql. If so,
is it possible to define a foreign key constraint
for a column in table-2 in database-2 which
references to a column in table-1 in database-1.
TIA

regards,
Deepa K.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

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

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.