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]