column type/typmod for domains in backend protocol

From: Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-interfaces(at)postgresql(dot)org
Subject: column type/typmod for domains in backend protocol
Date: 2003-04-09 12:02:34
Message-ID: 3E940BDA.5040609@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-odbc

Tom Lane wrote:
Re: [ODBC] using domain types with ODBC, esp. lo

>Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de> writes:
>
>
>In my schema definitions, I usually don't use basic datatypes, but self
>defined domains. This seems to work in general, but I encountered
>problems with blobs.
>
>I'm using CREATE DOMAIN t_image AS lo;
>
>While inserting data isn't sensitive to domains, selecting won't work.
>The reason is that the row's datatype obtained with CI_read_fields is
>compared to lo's oid. t_image's oid is different, so the column is
>handled wrong..
>
>
>
>>Actually, best thing for this problems would be if the backend would
>>deliver the base type oid, not the user type oid.
>>
>>
>
>There was some discussion of that idea in pgsql-hackers last week, but
>we didn't come to a definite conclusion. How do others feel about it?
>
> regards, tom lane
>
>
>
Tom,

is there any more conversation or decision about this I missed? I
couldn't find a thread about this topic in pgsql-hackers.
I don't think that anybody would notice a degradation of correctness of
the drivers if the backend delivered the base type instead of the domain
type id. The handling procedures are completely specified by the base
type and additional fields delivered (atttypmod/typmod), and so no more
distinction at that level should be necessary. Tools dealing with
non-basic types will certainly use direct access to pg_type etc on top
of a query interface instead of dealing with the low level protocol.
Reading up and down the Roadmap FE/BE protocol thread, I understand that
only basic information should be delivered automatically, not extended.
I consider a domain oid as extended, while basic information is what's
needed to interpret the data correctly.

If the protocol stays at it is, I'd have to implement some kind of type
cache in a custom odbc driver version, which is certainly quite a poor
way. At the moment, the odbc driver simply won't get the information it
needs.

Regards,
Andreas

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2003-04-09 15:06:33 Re: column type/typmod for domains in backend protocol
Previous Message Adam Witney 2003-04-09 11:47:03 Re: [Dbdpg-general] Re: Release of DBD-pg 1.22

Browse pgsql-odbc by date

  From Date Subject
Next Message Tom Lane 2003-04-09 15:06:33 Re: column type/typmod for domains in backend protocol
Previous Message Dave Page 2003-04-09 07:33:08 Re: continuing problems with sqlsetpos & syncing postgresql to a mobile database