Re: dblink vs dbi-link (and errors compiling)

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Ow Mun Heng *EXTERN*" <Ow(dot)Mun(dot)Heng(at)wdc(dot)com>, "Erik Jones" <erik(at)myemma(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: dblink vs dbi-link (and errors compiling)
Date: 2007-09-07 08:16:20
Message-ID: D960CB61B694CF459DCFB4B0128514C2298253@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ow Mun Heng wrote:
>>> In either of the above, I would like to know which one
>>> is able to help me to like connect to a remote DB, use the
>>> table there and join to a local table in PG so that I
>>> don't have to use DBI to pull and insert those data into
>>> the local PG database.
>>
>> Neither. To the best of my knowledge, there isn't anything
>> that will allow you to to do that.
>
> Ah.. Too bad.. There goes my "easy peasy life" out the window. But in
> any case, good to know.. dbi-link would be what I would want
> to try out.

True, you'll have to write some stuff that does something like:
- pull the data over from the other database
- replace the data in the local table

But I think that it does not matter if you use dblink or dbi-link
for that.

Since it is between PostgreSQL databases, I would probably prefer
dblink, because dbi-link is designed to work with ANY other database
that supports Perl::DBI and so preserves less of the PostgreSQL-ness
of the data - e.g. data type is lost, all data arrive as text.
Also, dbi-link has a more complicated architecture since it depends
on more things outside of PostgreSQL (naturally).

dbi-link is cool software though :^)

>>> BTW, dblink doesn't compile. (8.2.4)
>>>
>>> dblink.c:56:28: error: utils/fmgroids.h: No such file or directory
>
> BTW, this is gentoo and though I compiled it from source, the
> compiled tarballs are deleted.
>
> I did a configure in the PG source main dir and then proceeded to do a
> make in the contrib/dblink directory with above errors.

The correct way is like this:
cd into the PostgreSQL source directory
./configure with the correct arguments
make -C src/backend ../../src/include/utils/fmgroids.h
make -C contrib/dblink

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Denis Gasparin 2007-09-07 08:16:44 Connection Pooling directly on Postgres Server
Previous Message Ow Mun Heng 2007-09-07 07:49:36 Re: Column as arrays.. more efficient than columns?