Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9A3B21337BA6 for ; Mon, 21 Feb 2011 05:34:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 63860-06 for ; Mon, 21 Feb 2011 09:34:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f46.google.com (mail-bw0-f46.google.com [209.85.214.46]) by mail.postgresql.org (Postfix) with ESMTP id A2ED41337BA1 for ; Mon, 21 Feb 2011 05:34:14 -0400 (AST) Received: by bwz15 with SMTP id 15so972511bwz.33 for ; Mon, 21 Feb 2011 01:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=4id7BrB6XaKBYMAtubN7ukj8IpQ8e1VSWy7sSkeM7Us=; b=ClYKRvb368nnVxMWl5VIgR4YHcx9rCBXTb4Zm0VB8i742sCcHkvvmac59yZkwaQ4O7 +fgB8rXIJsiBRJxpdPlVtr3A7jJu5HLQOylm59u0r7598SDj3FobnEa2g9YXQM73gJIh 5ann9oBvkkmsrOm2yuitCMw1oDbv6mlNAmjg4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=ahZGgBAQvc97rty61jghcEaYtzr2yfn8m52URer29E3YOywfZ1lBGqtZAQkKz8Z4X9 DvXNg9UqnQ0cCpmHHEvWt20/GwQanAUfci96Npin9q2iU57sYZvaJ1BL5Vxitf5/hqTw WPPoHSxPziVTFASe/juNcAuhkYD9SR8IPUZsw= Received: by 10.204.73.160 with SMTP id q32mr1075532bkj.155.1298280853299; Mon, 21 Feb 2011 01:34:13 -0800 (PST) Received: from [10.1.1.57] (skuns.zoral.com.ua [91.193.166.194]) by mx.google.com with ESMTPS id q18sm3573733bka.3.2011.02.21.01.34.11 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Feb 2011 01:34:11 -0800 (PST) Message-ID: <4D623199.3010703@gmail.com> Date: Mon, 21 Feb 2011 11:34:17 +0200 From: Vitalii Tymchyshyn 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: RW Shore CC: pgsql-jdbc@postgresql.org Subject: Re: Array of compound not supported? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.046 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201102/128 X-Sequence-Number: 21526 Have you tried setObject(1, str, Types.OTHER); ? 20.02.11 01:02, RW Shore написав(ла): > I have a compound type defined as > > CREATE TYPE typedef.DECLASS_REASON_ENTRY AS ( > ENTRY_REASON VARCHAR(80), > AUTHORIZING_USER VARCHAR(20) > ) > > and a table defined as > > create table table102 (field1 typedef.declass_reason_entry[] ) > > The following statement works: > > insert into table102(field1) values > ('{"(\\"abcdef\\",\\"ghijkl\\")","(\\"abcdef\\",\\"ghijkl\\")"}') > > Consider the following prepared statement: > > insert into table102 (field1) values (?) > > If I use setString() on this prepared statement, execution throws a > variant of illegal type (complains about the parameter being a char > varying when it wants something else). If I use setObject() and pass > it a java.sql.Array implementation that wraps this same string, I get > a malformed array literal error.Note that the same code works fine > with arrays of all the built-in types, including point. No matter what > I do, I can't insert into the array of compound from my app. > > Anybody have any suggestions, or is array of compound simply not > supported via a prepared statement?