Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id B15D39F9F10 for ; Thu, 1 Feb 2007 13:52:49 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 44218-02 for ; Thu, 1 Feb 2007 13:52:44 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by postgresql.org (Postfix) with ESMTP id DD6CE9F9D4D for ; Thu, 1 Feb 2007 13:52:45 -0400 (AST) Received: by mail63.csoft.net (Postfix, from userid 1112) id 7C4C0F1B9; Thu, 1 Feb 2007 12:52:45 -0500 (EST) Date: Thu, 1 Feb 2007 12:52:45 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary2.csoft.net To: Jeffrey Cox cc: pgsql-jdbc@postgresql.org Subject: Re: getArray() and char[] In-Reply-To: <6F3C7223-5334-4EAA-8A81-9F2A0414FB1A@gmail.com> Message-ID: References: <6F3C7223-5334-4EAA-8A81-9F2A0414FB1A@gmail.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-620796469-1170352365=:7805" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/8 X-Sequence-Number: 16564 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-620796469-1170352365=:7805 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Thu, 1 Feb 2007, Jeffrey Cox wrote: > While looking into updating getProcedureColumns, to appropriately return > COLUMN_TYPE, ran into a 'not implemented' exception. Seems that getArray > is not implemented for arrays of type char. Kinda fuzzy on all this, but > walked the code and ultimately added an entry in TypeInfoCache for > 'char' and then updated AbstractJdbc2Array to handle 'char' as a > java.lang.Character[] rather than java.lang.String[] This is not quite right. The pg_proc column you are looking at is an array of "char" which is a special one byte datatype which is different than something like char(N) which is implemented by the bpchar type on the backend. The new TypeInfoCache code is correct, but the AbstractJdbc2Array must still return String[] since it must support the char(N) version as well. > it seems that the issue was that char[] was being identified as > Types.OTHER in TypeInfoCache. Which fixed the unimplemented error. > However, considering char[] as a String caused getArray() to return a > string containing leading and trailing curly brackets. Hence the change > to AbstractJdbc2Array. > I'm not sure why that would happen, perhaps it indicates another bug? I cannot duplicate it here with the attached test case and your TypeInfoCache changes. Kris Jurka --0-620796469-1170352365=:7805 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=ArrayTest.java Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=ArrayTest.java aW1wb3J0IGphdmEuc3FsLio7DQoNCnB1YmxpYyBjbGFzcyBBcnJheVRlc3Qg ew0KDQoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nIGFyZ3NbXSkg dGhyb3dzIEV4Y2VwdGlvbiB7DQoJCUNsYXNzLmZvck5hbWUoIm9yZy5wb3N0 Z3Jlc3FsLkRyaXZlciIpOw0KDQoJCUNvbm5lY3Rpb24gY29ubiA9IERyaXZl ck1hbmFnZXIuZ2V0Q29ubmVjdGlvbigiamRiYzpwb3N0Z3Jlc3FsOi8vbG9j YWxob3N0OjU4MjAvanVya2EiLCJqdXJrYSIsIiIpOw0KDQoJCVN0YXRlbWVu dCBzdG10ID0gY29ubi5jcmVhdGVTdGF0ZW1lbnQoKTsNCg0KCQlSZXN1bHRT ZXQgcnMgPSBzdG10LmV4ZWN1dGVRdWVyeSgiU0VMRUNUICd7aSxvLG99Jzo6 XCJjaGFyXCJbXSIpOw0KCQlycy5uZXh0KCk7DQoNCgkJQXJyYXkgYXJyID0g cnMuZ2V0QXJyYXkoMSk7DQoJCVN0cmluZyBzW10gPSAoU3RyaW5nW10pYXJy LmdldEFycmF5KCk7DQoJCWZvciAoaW50IGk9MDsgaTxzLmxlbmd0aDsgaSsr KSB7DQoJCQlTeXN0ZW0ub3V0LnByaW50bG4oc1tpXSk7DQoJCX0NCg0KCQlj b25uLmNsb3NlKCk7DQoJfQ0KfQ0K --0-620796469-1170352365=:7805--