up vote 1 down vote favorite

is there a way to create a select statement that would retrieve data from multiple database in postgre?

i was thinking it would be something like this:

select * from dbname1.table1, dbname2.table2 where dbname1.table1.column1 = dbname2.table2.column1

link|flag

2 Answers

up vote 2 down vote

Have a look at the "dblink" contrib module.

OTOH it's possible that you treat the databases in a PostgreSQL cluster as equivalent to the databases in... let's say MySQL. Which is incorrect - the PostgreSQL databases contain schemas and those are the equivalent of the databases in MySQL.

link|flag
up vote 0 down vote

From here:

It is not possible to access more than one database per connection.

Update: but see Milen's answer.

link|flag

Your Answer

get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.