Page 1 of 1

Cross Database Join

PostPosted: Thu Oct 28, 2010 10:00 am
by doco
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? :|

Re: Cross Database Join

PostPosted: Thu Oct 28, 2010 11:24 am
by WhiteRider
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

Re: Cross Database Join

PostPosted: Thu Oct 28, 2010 6:56 pm
by doco
Thanks WhiteRider. Its a bit confusing but I will get it - I think, maybe, well, OK I'll try ;-)

highfalutin