Re: dblink - custom datatypes NOW work :)

From: Mark Gibson <gibsonm(at)cromwell(dot)co(dot)uk>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: dblink - custom datatypes NOW work :)
Date: 2004-02-16 10:50:38
Message-ID: 4030A07E.9050009@cromwell.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Terry Lee Tucker 2004-02-16 12:39:25 Dazed and Confused
Previous Message Teodor Sigaev 2004-02-16 09:06:33 Re: making tsearch2 dictionaries

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-02-16 15:44:16 Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint
Previous Message Teodor Sigaev 2004-02-16 09:59:31 Re: Concurrence GiST

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-02-16 15:48:11 Re: [HACKERS] dollar quoting
Previous Message Andrew Dunstan 2004-02-16 02:16:21 Re: [PATCHES] dollar quoting