From: Oliver Jowett <oliver@opencloud.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Fix setArray() when using the v3 protocol (was Re: Postgres
Date: Fri, 08 Oct 2004 16:30:30 +1300
Message-ID: <416609D6.1040305@opencloud.com> (raw)
In-Reply-To: <27750.1097204681@sss.pgh.pa.us>
References: <002901c4aaf7$feabc310$a5010a0a@Johann>
<4162FFC9.3010808@opencloud.com>
<4164CBA2.80600@opencloud.com>
<4165F7B2.70705@opencloud.com>
<27750.1097204681@sss.pgh.pa.us>
Tom Lane wrote:
> Oliver Jowett <oliver@opencloud.com> writes:
>
>>! // Use a typename that is "_" plus the base type; this matches how the
>>! // backend looks for array types.
>>! String typename = "_" + x.getBaseTypeName();
>>! int oid = connection.getPGType(typename);
>>! if (oid == Oid.INVALID)
>>! throw new PSQLException("postgresql.prep.typenotfound", PSQLState.INVALID_PARAMETER_TYPE, typename);
>
>
> Er, what about schema-qualified type names?
We don't really support those anywhere else in the driver yet.
getPGType() certainly doesn't know how to handle them.
> Also, are you sure that
> getBaseTypeName will return the correct internal type name, eg "int8"
> not "bigint"?
It'll be correct for Array implementations generated by the driver. I
didn't see an easy way to get at the list of type aliases -- they appear
to only exist in the backend's query parser. A type alias view or
something similar would be nice to have..
If you're using your own Array implementation, you're playing with fire
anyway, as the current setArray() implementation is limited and fragile.
This patch is really just to get things back to the same level of
support as before the V3 protocol rewrite, not to fix all the other
problems.
-O
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, tgl@sss.pgh.pa.us
Subject: Re: Fix setArray() when using the v3 protocol (was Re: Postgres
In-Reply-To: <416609D6.1040305@opencloud.com>
References: <002901c4aaf7$feabc310$a5010a0a@Johann> <4162FFC9.3010808@opencloud.com> <4164CBA2.80600@opencloud.com> <4165F7B2.70705@opencloud.com> <27750.1097204681@sss.pgh.pa.us> <416609D6.1040305@opencloud.com>
* 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