Re: Procedural language functions across servers - Mailing list pgsql-general

From Mark Morgan Lloyd
Subject Re: Procedural language functions across servers
Date
Msg-id 44B2C4B9.FC5586EE@telemetry.co.uk
Whole thread Raw
In response to Procedural language functions across servers  (Mark Morgan Lloyd <markMLl.pgsql-general@telemetry.co.uk>)
List pgsql-general
Michael Fuhr wrote:

> dbi-link is an alternative to dblink that uses Perl/DBI:
>
> http://pgfoundry.org/projects/dbi-link/
>
> > is this the only way available if additional procedural languages
> > are installed?
>
> With the untrusted version of a language you can do essentially
> anything that language supports.  For example, with plperlu, you
> could use DBI to open a connection to another database (even another
> DBMS like Oracle, MySQL, etc.), issue a query, fetch the results,
> and do whatever you want with those results.  Example:
>
> CREATE FUNCTION remote_version(text, text, text) RETURNS text AS $$
>   use DBI;

As a related question, assume I have PostgreSQL on an application server X with
functions a() and b() defined to use some method (dblink or whatever) to return
a result set from a remote backend server.

If X runs a complex query including references to a() and b() which themselves
initiate complex queries on backend servers A and B, can I tell X's planner to
run a(A) and b(B) simultaneously, or is the only way to have these in distinct
sessions storing their results in tables on X?

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

pgsql-general by date:

Previous
From: marcelo Cortez
Date:
Subject: Re: encoding bug or feature?
Next
From: "Nikolay Samokhvalov"
Date:
Subject: Re: Getting Primary Key Value After Insert