Re: dblink - custom datatypes NOW work :) - Mailing list pgsql-hackers

From Mark Gibson
Subject Re: dblink - custom datatypes NOW work :)
Date
Msg-id 4030A07E.9050009@cromwell.co.uk
Whole thread Raw
In response to Re: dblink - custom datatypes NOW work :)  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
Joe Conway wrote:

> Mark Gibson wrote:
>
>>    I've found the problem, although I'm still a bit confused by it.
>
>
> I hate to do this to you now, but after some thought I think I have a 
> better approach -- I'd be interested in opinions on that assessment.
>
> The attached eliminates pgresultGetTupleDesc() entirely and instead 
> depends on the TupleDesc passed as rsinfo->expectedDesc from the 
> executor. What this means is that the string representation of the 
> remote value (from the "out" function on the remote side, as provided 
> by libpq) will get fed into the "in" function corresponding to the 
> local type you assign in your SQL statement. Assuming the types on the 
> two sides are the same (or at least compatible), it should work well.
>
> Please give this a try and let me know what you think.


Fantastic, works perfectly (well I've only actually tested it with the 
'txtidx' datatype).
That's so much better than my idea, i didn't like having the oid map 
much anyway.
Oh well, I least I've learnt I little about PostgreSQL internals in the 
process.
I can get back to what I was supposed to be doing now ;)

I'm going to give this a much through testing now.

Cheers

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



pgsql-hackers by date:

Previous
From: Teodor Sigaev
Date:
Subject: Re: Concurrence GiST
Next
From: Bruce Momjian
Date:
Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint