Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9A9A81337B97 for ; Mon, 10 Jan 2011 21:00:57 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 81981-02 for ; Tue, 11 Jan 2011 01:00:50 +0000 (UTC) X-Greylist: delayed 00:36:21.670933 by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id A6B201337B7D for ; Mon, 10 Jan 2011 21:00:49 -0400 (AST) Received: from 121-98-80-66.bitstream.orcon.net.nz ([121.98.80.66] helo=[192.168.1.2]) by tremor.opencloud.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PcS2A-0004Aw-Hb; Tue, 11 Jan 2011 13:24:22 +1300 Message-ID: <4D2BA330.9060009@opencloud.com> Date: Tue, 11 Jan 2011 13:24:16 +1300 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Lukas Eder CC: pgsql-jdbc@postgresql.org Subject: Re: Weird issues when reading UDT from stored function References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201101/24 X-Sequence-Number: 21356 On 11/01/11 12:06, Lukas Eder wrote: > CREATE TYPE u_street_type AS ( > street VARCHAR(100), > no VARCHAR(30) > ) > > CREATE TYPE u_address_type AS ( > street u_street_type, > zip VARCHAR(50), > city VARCHAR(50), > country u_country, > since DATE, > code INTEGER > ) > ==================================== > Output: > # of columns: 6 > ("(""Parliament Hill"",77)",NW31A9) > > Why are there 6 columns? And why is the UDT incorrectly fetched (many > fields are missing) Looks to me like you're getting each field of the UDT as a separate column. You printed only the first column i.e. the 'street' part. It might be informative to run with loglevel=2 and see how the server is returning results. If the driver is reporting 6 columns, that means that the server is reporting 6 fields in its RowDescription message. Oliver