Re: Refer to another database

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Refer to another database
Дата
Msg-id 4A77CBA9.6060802@hogranch.com
обсуждение исходный текст
Ответ на Re: Refer to another database  (Andreas Kalsch <andreaskalsch@gmx.de>)
Список pgsql-general
Andreas Kalsch wrote:
> This is what I want to do: To refer to another database, like I can do
> it in MySQL. After adding a schema with database name and refering to
> it from another database I get:
>
> ERROR:  schema "test" does not exist
>
> Adding the database name:
>
> osm_de=# select * from test.test.newt;
> ERROR:  cross-database references are not implemented: "test.test.newt"
>
> Could be very simple, if it would be like in MySQL ;) To be completely
> in context of a schema - so that I can use all tables without the
> prefix - I have to reset the search_path very often. This is probably
> not very elegant, but will be my solution then ...


if it would be "like in mysql", it wouldn't be postgresql.

in postgresql, if you have several namespaces that you want to use
together, use different namespaces in the same database.

now, if you want to 'use all tables without prefix', then why would you
use more than one database or schema or whatever?

the only alternative to access an alternate database within a query is
by using the contributed db_link module, and this is quite
restrictive.   since the two databases are completely seperate,
operations like joins are very expensive.





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

Предыдущее
От: Andreas Kalsch
Дата:
Сообщение: Re: Refer to another database
Следующее
От: John R Pierce
Дата:
Сообщение: Re: Refer to another database