Re: How to access a second database

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to access a second database
Date: 2017-10-31 07:57:50
Message-ID: fea778e4-b218-6dda-a0c4-dae3f55266c1@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/31/2017 12:41 AM, John R Pierce wrote:
> if you're doing a lot of this, why not use two schema in the same
> database?      then its just ...schema.table...
>
> otherwise, you need to use FDW and foreign tables.
>
> see....
> https://www.postgresql.org/docs/current/static/postgres-fdw.html

oh, I should add... the advantage of using FDW is the other database can
be on another server.   the disadvantage is, the remote data has to be
queried and merged with the local query, the optimizer may not be able
to do as good a job as it might with tables in different schema of the
same database (which are treated exactly the same as tables in the same
schema, other than naming).

--
john r pierce, recycling bits in santa cruz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rhhh Lin 2017-10-31 09:53:46 Re: Backup strategy using 'wal_keep_segments'
Previous Message John R Pierce 2017-10-31 07:41:52 Re: How to access a second database