Re: [GENERAL] dblink - custom datatypes don't work - Mailing list pgsql-hackers

From Mark Gibson
Subject Re: [GENERAL] dblink - custom datatypes don't work
Date
Msg-id 402A6E84.9020309@cromwell.co.uk
Whole thread Raw
In response to Re: [GENERAL] dblink - custom datatypes don't work  (Mark Gibson <gibsonm@cromwell.co.uk>)
Responses dblink - custom datatypes NOW work :)  (Mark Gibson <gibsonm@cromwell.co.uk>)
List pgsql-hackers
Mark Gibson wrote:

> Well, I've re-compiled PostgreSQL 7.4.1 with --enable-debug
> (was previously working with a Gentoo ebuild of it).
> And strangely I get a different error now:
>
> ERROR:  query-specified return row and actual function return row do 
> not match
>
> After placing a few elog statements around pgresultGetTupleDesc, i've 
> found the
> error happens after this function.
>
Thanks for the tips of using gdb.

I've found that dblink works without the oid map, ie: dblink(... , ... , 
false)
but returns the error when enabled, ie: dblink(... , ... , true)

The only part of dblink affected by this flag (use_oid_map) is within
'pgresultGetTupleDesc'

and the only variable affected is 'atttypid'
- which is left alone if use_oid_map is false.
When use_oid_map is true, SPI is used to prepare a query,
and execute it for each attribute - atttypid is then assigned the
value retreived from the query.

So when no custom types are used, the same values are passed to
'TupleDescInitEntry' whether use_oid_map is true or false.

I just can't work it out!

-- 
Mark Gibson <gibsonm |AT| cromwell |DOT| co |DOT| uk>
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.



pgsql-hackers by date:

Previous
From: Mike Benoit
Date:
Subject: Re: Summary of Changes since last release (7.4.1)
Next
From: "Jim C. Nasby"
Date:
Subject: Re: RFC: Security documentation