Cross Database Join

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

Cross Database Join

Postby doco » Thu Oct 28, 2010 10:00 am

I have discovered PostgreSQL will not allow cross database joins. Which is very, very odd. Anyway many of you have various databases to serve many purposes not the least of which is DB size. As for me I have a db that stores data from tables I have actually played and others storing data purchased or mined by other means.

Without getting into the gory details, it is often needed to join tables from one DB to tables in another: a common, practical and sensible thing to do with RDBMS. Or even migrate data from one db to another. So, my question is how would one share data across database boundaries on the fly? Or, should one, could one, put the entire contents of one database into the schema of another? That even sounds bad but is that the way it would be done? :|
doco
 
Posts: 130
Joined: Mon Sep 08, 2008 4:04 am
Location: E. Oregon USA

Re: Cross Database Join

Postby WhiteRider » Thu Oct 28, 2010 11:24 am

Yes, PostgreSQL does not support cross database queries by default.

There is an add-on module which [I'm told] will allow it although I have never personally used it:

http://www.postgresql.org/docs/8.3/static/dblink.html
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Cross Database Join

Postby doco » Thu Oct 28, 2010 6:56 pm

Thanks WhiteRider. Its a bit confusing but I will get it - I think, maybe, well, OK I'll try ;-)
doco
 
Posts: 130
Joined: Mon Sep 08, 2008 4:04 am
Location: E. Oregon USA


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 33 guests

cron
highfalutin