Hello,
   I've been experimenting with dblink recently, and have encountered some
limitations I'd like to discuss.

I've been trying to create views of remote tables, like so:

CREATE VIEW stuff AS
SELECT *
FROM dblink(' ... remote connection info ... ',
 'SELECT id, title, title_idx FROM stuff')
AS t(
 id integer,
 title text,
 title_idx txtidx
);

But, dblink seems to have a problem with the custom datatype 'txtidx' (from contrib/tsearch).

I get an error like this (from PostgreSQL 7.4.1):

ERROR: cache lookup failed for type 123456

Where 123456 is the pg_type.oid of the 'txtidx' type in the remote database,
which differs from the oid of the same datatype within the local database.

Are there anyways around this (other than trying to initialise the datatypes remotely and
locally with the same oid - which would be highly impractical).


Is this a limitation of PostgreSQL or dblink?
Could dblink use type names instead of oid's?
If not, could dblink be adapted to use some kind of
remote oid -> local oid mapping table for datatypes?

I would be willing to have a poke around in dblink.c,
if someone could confirm my findings and point me in the right direction.

Cheers

--
Mark Gibson <[EMAIL PROTECTED]>
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
     subscribe-nomail command to [EMAIL PROTECTED] so that your
     message can get through to the mailing list cleanly

Reply via email to