dblink - custom datatypes don't work

Поиск
Список
Период
Сортировка
От Mark Gibson
Тема dblink - custom datatypes don't work
Дата
Msg-id 40225761.8000706@cromwell.co.uk
обсуждение исходный текст
Ответы Re: dblink - custom datatypes don't work  (Joe Conway <mail@joeconway.com>)
Список 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 по дате отправления:

Предыдущее
От: Mike Charnoky
Дата:
Сообщение: pg_restore and large files
Следующее
От: Iker Arizmendi
Дата:
Сообщение: ERROR: column 'xxx' does not exist (under v. 7.4.1)