From: Andreas Pflug <Andreas.Pflug@web.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-interfaces@postgresql.org
Subject: column type/typmod for domains in backend protocol
Date: Wed, 09 Apr 2003 14:02:34 +0200
Message-ID: <3E940BDA.5040609@web.de> (raw)
In-Reply-To: <13532.1048264312@sss.pgh.pa.us>
References: <3E7B3BA7.20709@web.de>
<13532.1048264312@sss.pgh.pa.us>
Tom Lane wrote:
Re: [ODBC] using domain types with ODBC, esp. lo
>Andreas Pflug <Andreas.Pflug@web.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: Andreas.Pflug@web.de, tgl@sss.pgh.pa.us
Subject: Re: column type/typmod for domains in backend protocol
In-Reply-To: <3E940BDA.5040609@web.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox