dblink - custom datatypes don't work - Mailing list pgsql-general

From Mark Gibson
Subject dblink - custom datatypes don't work
Date
Msg-id 40225761.8000706@cromwell.co.uk
Whole thread Raw
Responses Re: dblink - custom datatypes don't work
List pgsql-general
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 <gibsonm@cromwell.co.uk>
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.



pgsql-general by date:

Previous
From: Mike Charnoky
Date:
Subject: pg_restore and large files
Next
From: Iker Arizmendi
Date:
Subject: ERROR: column 'xxx' does not exist (under v. 7.4.1)