Re: select result / functions from another database

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Matthew Peter <survivedsushi(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: select result / functions from another database
Date: 2006-11-18 02:28:06
Message-ID: 200611180228.kAI2S6m18709@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton wrote:
> Matthew Peter wrote:
> > I have DB1 and DB2 pg_databases... I then have a function in DB2 that
> > wants some results from DB1, is it possible to query another db? Like
> > how \! lets you hit the command line... but I need it in plpgsql if
> > possible.
>
> Look into the db_link or dbi_link packages. These are exactly what you
> are after.

Uh, folks, we have an FAQ item on this:

<H3 id="item4.17">4.17) How do I perform queries using
multiple databases?</H3>

Please point folks to the FAQ, because if they don't know this answer,
they don't know other answers as well.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2006-11-18 02:39:39 Re: [HACKERS] Shutting down a warm standby database in 8.2beta3
Previous Message Bruce Momjian 2006-11-18 02:26:21 Re: [GENERAL] ISO week dates