Cross-database tables

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Cross-database tables
Дата
Msg-id befe3ba109850821c46b1877da1ca82c.1yyiUmKVrL9Sn@rjohnson.com
обсуждение исходный текст
Ответы Re: Cross-database tables  ("Brett W. McCoy" <bmccoy@chapelperilous.net>)
Список pgsql-novice
Hi,

I'd love it if I could access tables from other databases.

Is there a way to do this?

Here's some sample pseudo-SQL in case I wasn't clear about that:

    select * from database1^table3, database2^table4;

Which would do something similar to:

    psql -d database1 -c 'select * from table3;'
    psql -d database2 -c 'select * from table4;'

All I see when I've read docs, or checked other sources is that databases
are separate, and can't access other info.

I suppose that answers my question -- but it just doesn't seem right.
It'd seem like there oughtta be a way, somehow, to access (at least read!)
data from multiple tables in multiple databases -- at least on the same
site.

There are only two other ways I can think of to do this...

  1)    Consolidate all tables into a single database.  I'd have a lot of
    stuff in that database then.  Uck.

  2)    Write scripts that access both databases, and essentially duplicate
    some of the database functions in the script.

So far, I do small parts of method 2, and in some cases, simply copy info
from one database to another, duplicating it.

Any other ideas are welcome.

--
RJohnson.com -+- Ron Johnson <rjohnson@rjohnson.com>
http://www2.rjohnson.com/me/1yyiUmKVrL9Sn/


В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Join question
Следующее
От: "Brett W. McCoy"
Дата:
Сообщение: Re: Cross-database tables