Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id EA3416335B2 for ; Thu, 18 Feb 2010 01:17:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 97688-06-2 for ; Thu, 18 Feb 2010 05:17:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail.postgresql.org (Postfix) with ESMTP id 4D842633440 for ; Thu, 18 Feb 2010 01:17:32 -0400 (AST) Received: by leary.csoft.net (Postfix, from userid 1112) id 7F09BA3C0; Thu, 18 Feb 2010 00:17:30 -0500 (EST) Date: Thu, 18 Feb 2010 00:17:29 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Jason Tesser cc: pgsql-jdbc Subject: Re: Correct way to send a composite type to Postgres In-Reply-To: <98bbb46a1002160313m25967352s8b59e480e778d5c4@mail.gmail.com> Message-ID: References: <98bbb46a1002160313m25967352s8b59e480e778d5c4@mail.gmail.com> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.54 tagged_above=-10 required=5 tests=AWL=0.059, BAYES_00=-2.599 X-Spam-Level: Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Archive-Number: 201002/29 X-Sequence-Number: 20316 On Tue, 16 Feb 2010, Jason Tesser wrote: > I have a composite type that is an IN parameter for a Stored Function.=A0= How > do I construct the type in Java? >=20 > I know in Postgres I can do row(....)=A0 I was hoping for something a lit= tle > more Javaish instead to having to build that String. >=20 > Can I extend PGObject to accomplish this? Currently there isn't a great way to do this with the PG JDBC driver. You= =20 can encapsulate the ugliness with PGObject, but you can't avoid it. If=20 you have a type that extends PGObject all you need to do is override the=20 toString method to format the data as the server expects it. Kris Jurka=