From ringerc@ringerc.id.au Wed Aug 22 03:09:24 2012 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T41Js-0006le-3I for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 03:09:24 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T41Jp-0007wz-AU for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 03:09:23 +0000 Received: by pbbrr13 with SMTP id rr13so822908pbb.19 for ; Tue, 21 Aug 2012 20:09:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:x-gm-message-state; bh=Ca3KBmwZBRlDku8LA/6YUP4kdzfnDZDcLwcmeJiXAt4=; b=lER9+GQtTxkYE7yla0RVSQnyV8us7yINfmgxd32VWAP+SOjd8NeMqGCUJSRl5dWW1/ TdX+IkH/B+sc3nEdcv1uurVUXX5iXDyiyCYDW6HrBA+5Bb99Y25vbME8lSwKa1Rft8a6 9sUS2e3JjckpChcW8DvszU1EENjLLZuBQxUJb9piqeDMD27+OMx6JC4AqIB/mMzfnj2u sEXt3CysYFVm12NgD8HOcHEO8IbPZokIDUyieABb/EeHglzJgh1iOarAELRdQXqQtF+r eNVFfM+3Xlw2HmkYlvM5mLzrRV5JTNnMLsP2N7ckcODRBzkmj8+1h3D0dD9BasLgwe90 XArg== Received: by 10.68.234.65 with SMTP id uc1mr29073876pbc.89.1345604957661; Tue, 21 Aug 2012 20:09:17 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id gf3sm2686864pbc.74.2012.08.21.20.09.14 (version=SSLv3 cipher=OTHER); Tue, 21 Aug 2012 20:09:16 -0700 (PDT) Message-ID: <50344D58.9010401@ringerc.id.au> Date: Wed, 22 Aug 2012 11:09:12 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: PostgreSQL JDBC Subject: setObject(...) with native Java arrays like String[] ? Content-Type: multipart/alternative; boundary="------------010909080807080100090307" X-Gm-Message-State: ALoCoQmq/A52mcfEJuGnpiOegX8nlw5BilVMQ5N8aK0YXvTGzHQIIapkCCzHrQlmsZDlYAYRFiCS X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/53 X-Sequence-Number: 23208 This is a multi-part message in MIME format. --------------010909080807080100090307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi all I was recently surprised to find that PgJDBC doesn't accept Java arrays as parameters to prepared statements. For example: PreparedStatement.setObject(1, new String[]{"a"}). will fail with: [ERROR] Internal Exception: org.postgresql.util.PSQLException: Can't infer a SQL type to use for an instance of [Ljava.lang.String;. Use setObject () with an explicit Types value to specify the type to use. ... which I've verified with the 902 driver in git. After reading the spec I can't see anywhere the JDBC driver is required to accept native Java arrays, but at least EclipseLink seems to want to do it anyway. Is this reasonable to support? There's one par in the JDBC spec that suggests it might be supposed to work, but I'm not convinced it's more than bad phrasing. In §16.5.4 the JDBC4.2 draft spec reads: A Java array may be passed as an input parameter by calling the method PreparedSatement.setObject. Thoughts? Opinions? Any idea what other DBs drivers do when they get passed a raw Java array to setObject() ? Source: http://stackoverflow.com/questions/12042181/how-can-i-set-a-string-parameter-to-a-native-query/12065537#12065537 -- Craig Ringer --------------010909080807080100090307 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi all

I was recently surprised to find that PgJDBC doesn't accept Java arrays as parameters to prepared statements.

For example:

    PreparedStatement.setObject(1, new String[]{"a"}).

will fail with:

[ERROR] Internal Exception: org.postgresql.util.PSQLException: Can't infer a SQL
type to use for an instance of [Ljava.lang.String;.
Use setObject () with an explicit Types value to specify the type to use.

... which I've verified with the 902 driver in git.

After reading the spec I can't see anywhere the JDBC driver is required to accept native Java arrays, but at least EclipseLink seems to want to do it anyway. Is this reasonable to support? There's one par in the JDBC spec that suggests it might be supposed to work, but I'm not convinced it's more than bad phrasing. In §16.5.4 the JDBC4.2 draft spec reads:

    A Java array may be passed as an input parameter by calling the method
    PreparedSatement.setObject.


Thoughts? Opinions? Any idea what other DBs drivers do when they get passed a raw Java array to setObject() ?

Source:

http://stackoverflow.com/questions/12042181/how-can-i-set-a-string-parameter-to-a-native-query/12065537#12065537

--
Craig Ringer
--------------010909080807080100090307-- From ringerc@ringerc.id.au Wed Aug 22 03:31:18 2012 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T41f4-0000vG-Qh for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 03:31:18 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T41f3-0008Ig-HZ for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 03:31:18 +0000 Received: by pbbrr13 with SMTP id rr13so843923pbb.19 for ; Tue, 21 Aug 2012 20:31:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=DpJ/AhkNsx64HjfFBtaPR7uNTQGzCuFC1u4PhQ3EZzw=; b=nPlHOgFO6uzkdWbIb4KS2hUAvvR6vRdNoQTyyq8D+tO5AUA84h39JjX8b5p1EgtnA5 2tV4WR/mXlqAkDVqjwdja0/FsRDK5kzEaaqJMJP2HQe/tciKjviIxWYuFs06QQVb2OL3 RZ3zhJsSCeLLQKtFPA1PbniUG3cBxLLFy5CIfeMvD+jSQU6hr+ZpmC+vCpQeLEUlrPD1 92djv5Sz8UUkawsWuKGTrsok6e/rZ0DmpIE8iQTXeqJ5QGRSyWVLeTKK+rLwOvzND4BR Lf9MY0ToiRwOjMWZBQOlB65pLcj6sz+mfteAP8jsuwBVnthZQknRaSY7cu0+cLbK/rMz 8SOA== Received: by 10.68.238.166 with SMTP id vl6mr48692149pbc.96.1345606276318; Tue, 21 Aug 2012 20:31:16 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id nr2sm2742562pbc.48.2012.08.21.20.31.13 (version=SSLv3 cipher=OTHER); Tue, 21 Aug 2012 20:31:15 -0700 (PDT) Message-ID: <5034527F.5040609@ringerc.id.au> Date: Wed, 22 Aug 2012 11:31:11 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: PostgreSQL JDBC Subject: Re: setObject(...) with native Java arrays like String[] ? References: <50344D58.9010401@ringerc.id.au> In-Reply-To: <50344D58.9010401@ringerc.id.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlxkq+ozvws78t/4FKmmVtmqDhWG6dyg4dLpoQFW2hAQHw3mJq8U82lHarZXJjvMI8SKHmH X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/54 X-Sequence-Number: 23209 Here's a proposed patch to the tests to make the current behaviour explicit: Add tests for String[] arrays Shows that Connection.createArrayOf works, and that passing a raw Java String[] to PreparedStatement.setObject() isn't accepted. --- org/postgresql/test/jdbc2/ArrayTest.java | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/org/postgresql/test/jdbc2/ArrayTest.java b/org/postgresql/test/jdbc2/ArrayTest.java index 16b0823..7b796be 100644 --- a/org/postgresql/test/jdbc2/ArrayTest.java +++ b/org/postgresql/test/jdbc2/ArrayTest.java @@ -186,6 +186,37 @@ public class ArrayTest extends TestCase assertEquals(3, resultCount); } + public void testSetObjectFromJavaArray() throws SQLException { + String[] strArray = new String[]{"a","b","c"}; + + PreparedStatement pstmt = conn.prepareStatement("INSERT INTO arrtest(strarr) VALUES (?)"); + + // Incorrect, but commonly attempted by many ORMs: + try { + pstmt.setObject(1, strArray, Types.ARRAY); + pstmt.executeUpdate(); + fail("setObject() with a Java array parameter and Types.ARRAY shouldn't succeed"); + } catch (org.postgresql.util.PSQLException ex) { + // Expected failure. + } + + // Also incorrect, but commonly attempted by many ORMs: + try { + pstmt.setObject(1, strArray); + pstmt.executeUpdate(); + fail("setObject() with a Java array parameter and no Types argument shouldn't succeed"); + } catch (org.postgresql.util.PSQLException ex) { + // Expected failure. + } + + // Correct way, though the use of "text" as a type is non-portable. + Array sqlArray = conn.createArrayOf("text", strArray); + pstmt.setArray(1, sqlArray); + pstmt.executeUpdate(); + + pstmt.close(); + } + /** * Starting with 8.0 non-standard (beginning index isn't 1) bounds * the dimensions are returned in the data. The following should -- 1.7.11.2 From ringerc@ringerc.id.au Wed Aug 22 03:32:58 2012 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T41gg-00027G-2Y for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 03:32:58 +0000 Received: from mail-pz0-f46.google.com ([209.85.210.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T41ge-000325-AO for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 03:32:57 +0000 Received: by dady13 with SMTP id y13so387823dad.19 for ; Tue, 21 Aug 2012 20:32:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:x-gm-message-state; bh=MlylZnpoGEEQFQpCIxKT32WU6Afc8d2sT140yIC1vw0=; b=cfzCbsI+kMkOf5llA6LIGks+rEBxOdIzDftH6MgBK0KHK6cSg9vM5sGDLTX5TgeUBU cLNsEB7sBfV1v44dlbAHBeXjq6dwhFb+3w4iaKBjUO+ISC1DfN10f8uocU5AUToOzQ5k zw7WROsHGbU7yeWa99x4ysOOHZCJlnckQWDYfTVlyC5aDLxxY/OVCrmZ9hc7p89M1AYt WdDseu8vJp/RIcsj6PhxqBtt39/kt1HTF0qIHxAbmuy9cOdy9oAA7h5W1LMLqsR8DQAr jHs/+SFKJuhYfA4jNnK7WgxVSXaVJ25tBui2VGeN5WCq2WDgNEjDt6VsfhyppQcbfuVw /06g== Received: by 10.68.138.135 with SMTP id qq7mr49734251pbb.167.1345606374773; Tue, 21 Aug 2012 20:32:54 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id oj8sm2741551pbb.54.2012.08.21.20.32.52 (version=SSLv3 cipher=OTHER); Tue, 21 Aug 2012 20:32:53 -0700 (PDT) Message-ID: <503452E2.9090006@ringerc.id.au> Date: Wed, 22 Aug 2012 11:32:50 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: PostgreSQL JDBC Subject: Re: setObject(...) with native Java arrays like String[] ? References: <50344D58.9010401@ringerc.id.au> In-Reply-To: <50344D58.9010401@ringerc.id.au> Content-Type: multipart/mixed; boundary="------------080306030308000007010805" X-Gm-Message-State: ALoCoQnGxWanAj5f+xrdsVPHj3AekJNzJnPdHQ4iRROmEi47l90wzPneQ7CGqWE34bcGP5hjMFvx X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/55 X-Sequence-Number: 23210 This is a multi-part message in MIME format. --------------080306030308000007010805 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sorry, mail client mangled the line wrapping. Attached patch that makes the current behaviour explicit. --------------080306030308000007010805 Content-Type: text/x-patch; name="0001-Add-tests-for-String-arrays.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Add-tests-for-String-arrays.patch" --------------080306030308000007010805-- From ringerc@ringerc.id.au Wed Aug 22 03:34:18 2012 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T41hy-0003FB-CR for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 03:34:18 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T41hx-00032C-Em for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 03:34:17 +0000 Received: by pbbrr13 with SMTP id rr13so846807pbb.19 for ; Tue, 21 Aug 2012 20:34:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=MqoTOdTugwLwFXGAU1TzNzMUKhkUkHBlMOLCJk1JNeo=; b=FJRrs1o19xzka2MuTbMzxn8J5X8cmCfcVgMzfWnrjzv31REG0+7BmwjNPym8t5dmD3 C+iN1Dq/CNEdt3L/pTjyDn8y1cMfICU5LnaGTFdZ663rakx92GdHsLlcAhiB7GMrDaQl B9kyGXI2hy0zC5S9LnGAFzUJmYKxG1E5bMbKrLsWyYdudqrgMVitGIpdNYlcftAFyCPB zC9/3ApSWqBVr2tiDCTJE6JQSv/ZsWmUm/3lj9i9bdfDo0CkdmjVETjCw0CeQ8ijrbzw jJ9WT+Cl8V9/phwvFPj604falR+vP86zi04RFbgM/FmptygYNrZLu2EoOlbl6STOEic/ JuYg== Received: by 10.68.224.73 with SMTP id ra9mr48899232pbc.85.1345606456807; Tue, 21 Aug 2012 20:34:16 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id uu10sm2771777pbc.2.2012.08.21.20.34.14 (version=SSLv3 cipher=OTHER); Tue, 21 Aug 2012 20:34:15 -0700 (PDT) Message-ID: <50345334.5010205@ringerc.id.au> Date: Wed, 22 Aug 2012 11:34:12 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: PostgreSQL JDBC Subject: Re: setObject(...) with native Java arrays like String[] ? References: <50344D58.9010401@ringerc.id.au> In-Reply-To: <50344D58.9010401@ringerc.id.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnfd6l1o09hlTkoIbvEtaUYdq3wYBJHY5i3PiRfHJQKHyTkQQIAW8pPkAorgAITfc68G2lv X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/56 X-Sequence-Number: 23211 Also, maybe something this should go in the README? --------------------------------------------------------------------------- TESTING If you want to run the unit tests, create a user with username "test" and password "password" in a Pg instance that listens on 127.0.0.1:5432 (the default). Create a database "test" owned by user "test". psql -U postgres postgres=# CREATE USER test WITH PASSWORD 'test'; postgres=# CREATE DATABASE test OWNER test; Now run "ant test" to execute the tests against your new DB. You should drop the test user and DB after testing as the well-known password could lead to a security issue. --------------------------------------------------------------------------- From m.sakrejda@gmail.com Wed Aug 22 04:52:13 2012 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T42vN-0001NX-9R for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 04:52:13 +0000 Received: from mail-ob0-f174.google.com ([209.85.214.174]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T42vH-00018B-Rn for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 04:52:12 +0000 Received: by obbuo13 with SMTP id uo13so855974obb.19 for ; Tue, 21 Aug 2012 21:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Vo4pEeoUM4Em5mxqADfbCWG9OvSFIO95R7Iy6Jx6qg8=; b=zYIbUZALHeyUmstC6/8M7T94+gp6Lz3u3A6qaqVyES6UWPLOvV/pk7+0F2MFlvLpWP XswjLih4zVBXUiURhDc1J4GF5ONbSsrCelg76Y9SZizh/uacKq35sH7o9ChAA9MkgSBS W8HAmG5wVq0Ibdieu8JvByvrMDd9bCGNqbz1ydQOX7zCouH5+aosH//+k2XPsrcrdopR ogRv2W0T0YNjzJv2404k9r1yN5UP2cZ511bQj6iPn0wE8y17fVjinbBC6sz3ISZZjm7a rfO/HA1rIRJMazAZGZiYNsDfbYbLsQQBXoqVWJtfUNatvDu+DpkcnAxs6LYt83ne7GUp lV5A== MIME-Version: 1.0 Received: by 10.60.169.8 with SMTP id aa8mr14425304oec.109.1345611126137; Tue, 21 Aug 2012 21:52:06 -0700 (PDT) Received: by 10.182.92.133 with HTTP; Tue, 21 Aug 2012 21:52:06 -0700 (PDT) In-Reply-To: <50345334.5010205@ringerc.id.au> References: <50344D58.9010401@ringerc.id.au> <50345334.5010205@ringerc.id.au> Date: Tue, 21 Aug 2012 21:52:06 -0700 Message-ID: Subject: Re: setObject(...) with native Java arrays like String[] ? From: Maciek Sakrejda To: Craig Ringer Cc: PostgreSQL JDBC Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201208/57 X-Sequence-Number: 23212 On Tue, Aug 21, 2012 at 8:34 PM, Craig Ringer wrote: > Also, maybe something this should go in the README? org/postgresql/test actually has its own testing-specific README, although perhaps there should be a note of it somewhere more obvious. From john.lister@kickstone.com Wed Aug 22 06:39:55 2012 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T44bb-0000Cl-5q for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 06:39:55 +0000 Received: from out1.ip01ir2.opaltelecom.net ([62.24.128.237]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T44bZ-0002lJ-4Z for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 06:39:54 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMBADx+NFBPS0U//2dsb2JhbAANOLcyhk4JAQEBAQN4EQsDARQJFg8JAwIBAgFFEwgBAa1YlBKLCIQAgxwDqEc X-IronPort-AV: E=Sophos;i="4.77,808,1336345200"; d="scan'208,217";a="401596668" Received: from 79-75-69-63.dynamic.dsl.as9105.com (HELO [192.168.6.20]) ([79.75.69.63]) by out1.ip01ir2.opaltelecom.net with ESMTP; 22 Aug 2012 07:39:51 +0100 Message-ID: <50347EBC.2090505@kickstone.com> Date: Wed, 22 Aug 2012 07:39:56 +0100 From: John Lister User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: setObject(...) with native Java arrays like String[] ? References: <50344D58.9010401@ringerc.id.au> In-Reply-To: <50344D58.9010401@ringerc.id.au> Content-Type: multipart/alternative; boundary="------------050109000806060708060807" X-Pg-Spam-Score: -1.2 (-) X-Archive-Number: 201208/58 X-Sequence-Number: 23213 This is a multi-part message in MIME format. --------------050109000806060708060807 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 22/08/2012 04:09, Craig Ringer wrote: > > I was recently surprised to find that PgJDBC doesn't accept Java > arrays as parameters to prepared statements. As was I, I posted a patch a couple of months ago that did the same thing but also accepted java List types as well (I'm often using these especially with JPA and it would be nice to pass them into the driver), although it seems to have been silently ignored. Maybe I'll repost it. John --------------050109000806060708060807 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 22/08/2012 04:09, Craig Ringer wrote:

I was recently surprised to find that PgJDBC doesn't accept Java arrays as parameters to prepared statements.
As was I, I posted a patch a couple of months ago that did the same thing but also accepted java List types as well (I'm often using these especially with JPA and it would be nice to pass them into the driver), although it seems to have been silently ignored. Maybe I'll repost it.

John
--------------050109000806060708060807-- From danap@ttc-cmc.net Wed Aug 22 15:26:34 2012 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4CpG-0002rU-LC for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 15:26:34 +0000 Received: from outbound.vnet-inc.com ([216.146.104.103]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4CpD-00029E-8I for pgsql-jdbc@postgresql.org; Wed, 22 Aug 2012 15:26:33 +0000 Received: from [192.168.157.132] (unknown [76.75.27.41]) by outbound.vnet-inc.com (Postfix) with ESMTP id B2FD45A29 for ; Wed, 22 Aug 2012 09:26:29 -0600 (MDT) Message-ID: <5034F837.7060103@ttc-cmc.net> Date: Wed, 22 Aug 2012 09:18:15 -0600 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.13) Gecko/20100914 SeaMonkey/2.0.8 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: setObject(...) with native Java arrays like String[] ? References: <50344D58.9010401@ringerc.id.au> <50347EBC.2090505@kickstone.com> In-Reply-To: <50347EBC.2090505@kickstone.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/59 X-Sequence-Number: 23214 > On 22/08/2012 04:09, Craig Ringer wrote: >> >> I was recently surprised to find that PgJDBC doesn't accept Java >> arrays as parameters to prepared statements. I'm not surprised at this behavior since I needed to support all data types with the MyJSQLView application for PostgreSQL. The app uses prepare statements for inserts/updates and I found out very early that all data types needed to be explicitly stated for prepare statements. This is not the JDBC from my understanding, but rather the PostgreSQL server. You can get away with this in other databases, but not so for PostgreSQL. One way around this I found is send the data with the initial prepare statement creation. This of course precludes recursive use then of the statement. Kinda defeats the purpose, but for singluar inserts/update works fine. It looks like from your code the arrays you speak of are not java.sql.Array? > John Lister wrote: > As was I, I posted a patch a couple of months ago that did the same > thing but also accepted java List types as well (I'm often using these > especially with JPA and it would be nice to pass them into the driver), > although it seems to have been silently ignored. Maybe I'll repost it. John, the Silence I think is not purposeful. With the port to GIT does this not allow contributors to more easily process patches independently? I'm not that familiar with GIT so I apologize up front for my ignorance. danap. From ringerc@ringerc.id.au Thu Aug 23 01:32:22 2012 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4MHW-00038b-TH for pgsql-jdbc@postgresql.org; Thu, 23 Aug 2012 01:32:22 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4MHS-0002sd-MQ for pgsql-jdbc@postgresql.org; Thu, 23 Aug 2012 01:32:20 +0000 Received: by pbbrr13 with SMTP id rr13so379597pbb.19 for ; Wed, 22 Aug 2012 18:32:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=2lzleFIE+2PQrYCB0CeF/TUJUOPTFoXcBQCz4u7GZnM=; b=IhLnaFKcm3RcWPQng2QESBkwd03mZetwoGl7Jaylv2udX5zawWIfqm24FfaZdiYmfX 06nWuvaam0jYZR8YU/VJjKYrNbTfwP8fcr7eOIfYdJqbSc+kFbSlHRwc9fxnarcbkugY yOyk2xE9KwLTTwhncM9lc6pHQziwjUSFNcS+pbqRsLyW2Y3y6OeuNdNa/p8Wsj5u2Daq BpERf4tJdLBd3jdCV4W6IG4NkO1ZNmZb9sNH4JzMpj6visH34l1pStNQMfp4hTP2PQz5 cT9Tt6a2nFBG4MqYJ9jb8Rwt58ZZbrAF3AcCGIfrnbw5Eprw0DjeiyaX8tBwxwRNdDm2 CXsA== Received: by 10.68.196.193 with SMTP id io1mr572455pbc.17.1345685535349; Wed, 22 Aug 2012 18:32:15 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id pj10sm4818368pbb.46.2012.08.22.18.32.12 (version=SSLv3 cipher=OTHER); Wed, 22 Aug 2012 18:32:14 -0700 (PDT) Message-ID: <5035881A.5030805@ringerc.id.au> Date: Thu, 23 Aug 2012 09:32:10 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: dmp CC: pgsql-jdbc@postgresql.org Subject: Re: setObject(...) with native Java arrays like String[] ? References: <50344D58.9010401@ringerc.id.au> <50347EBC.2090505@kickstone.com> <5034F837.7060103@ttc-cmc.net> In-Reply-To: <5034F837.7060103@ttc-cmc.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmgYW847XT29m9cYVCJi6VD3VwzV5F1egV4/nWvYtUWvZJaMf0xTnqOOOgdQT9kmavHrbYF X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/60 X-Sequence-Number: 23215 On 08/22/2012 11:18 PM, dmp wrote: > One way around this I found is send the data with the initial prepare > statement creation. ... which is OK if you know what SQL injection is and you're really careful, but not something that any user should ever be advised to do or need to do. > It looks like from your code the arrays you speak of are not > java.sql.Array? Correct, I'm asking whether PgJDBC should also accept native Java arrays like String[] and convert them to java.sql.Array with appropriate type inference its self. It's correct to use java.sql.Array and Connection.createArrayFrom(...) but it's evident that some in-the-wild code, including EclipseLink, doesn't do that and expects the JDBC driver to accept raw arrays. > John, the Silence I think is not purposeful. I don't remember seeing the patch, actually. http://www.postgresql.org/search/?m=1&q=John+Lister&l=19&d=365&s=d The Pg mailing list manager is irritatingly good at eating messages with attached patches, so it's possible nobody ever saw it. > With the port to GIT does > this not allow contributors to more easily process patches independently? > I'm not that familiar with GIT so I apologize up front for my ignorance. Pg is using a traditional patch-based workflow not a push-pull workflow, so even if you do your work in public git branches you need to send patches to get things merged, you can't just post a git ref or use a GitHub pull request. That doesn't mean it's useless to keep your work in git. I keep the few patches I write for Pg in feature branches on my public GitHub account: https://github.com/ringerc/pgjdbc https://github.com/ringerc/postgres primarily so I don't lose it, and I refer to the feature branch when I post a patch, eg: https://github.com/ringerc/postgres/tree/sequence_documentation_fixes However, there'll never be a merge from my branch in the history, either via a git merge commit or a fast-forward pull, because the changes enter Pg via patches. Of course, even if John did have the work in a git repo, the next question would be "where and in which branch" ? You still need a way to find the work. Is it on GitHub somewhere? In a branch of a user repo on git.postgresql.org ? On some personal server that allows public read-only git access? Without a URL git isn't any more help than a patch. -- Craig Ringer From john.lister@kickstone.com Thu Aug 23 07:47:13 2012 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4S8H-0006bF-Ox for pgsql-jdbc@postgresql.org; Thu, 23 Aug 2012 07:47:13 +0000 Received: from out1.ip02ir2.opaltelecom.net ([62.24.128.238]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4S8F-00007T-RJ for pgsql-jdbc@postgresql.org; Thu, 23 Aug 2012 07:47:13 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMBAF3fNVBPS0U//2dsb2JhbAANOL10AQEBAQM4NgoRCxgJFg8JAwIBAgFFEwgBAQWID6UHk36LCIN1gxwDqEk X-IronPort-AV: E=Sophos;i="4.80,299,1344207600"; d="scan'208";a="401429868" Received: from 79-75-69-63.dynamic.dsl.as9105.com (HELO [192.168.6.20]) ([79.75.69.63]) by out1.ip02ir2.opaltelecom.net with ESMTP; 23 Aug 2012 08:47:09 +0100 Message-ID: <5035E003.1040606@kickstone.com> Date: Thu, 23 Aug 2012 08:47:15 +0100 From: John Lister User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: setObject(...) with native Java arrays like String[] ? References: <50344D58.9010401@ringerc.id.au> <50347EBC.2090505@kickstone.com> <5034F837.7060103@ttc-cmc.net> <5035881A.5030805@ringerc.id.au> In-Reply-To: <5035881A.5030805@ringerc.id.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.2 (-) X-Archive-Number: 201208/61 X-Sequence-Number: 23216 On 23/08/2012 02:32, Craig Ringer wrote: > I don't remember seeing the patch, actually. > > http://www.postgresql.org/search/?m=1&q=John+Lister&l=19&d=365&s=d > > The Pg mailing list manager is irritatingly good at eating messages > with attached patches, so it's possible nobody ever saw it. Odd, I remember getting the copy from the list, but not to worry, I've added a couple of tests and waiting while they run, will then repost it. John From pg@fastcrypt.com Thu Aug 23 15:01:20 2012 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4YuO-0006tv-1x for pgsql-jdbc@postgresql.org; Thu, 23 Aug 2012 15:01:20 +0000 Received: from mail-vb0-f46.google.com ([209.85.212.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4YuM-0008IV-N9 for pgsql-jdbc@postgresql.org; Thu, 23 Aug 2012 15:01:19 +0000 Received: by vbbff1 with SMTP id ff1so872762vbb.19 for ; Thu, 23 Aug 2012 08:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=no8aL8MSOLzS3eZh+3C3msRpc/Lh/nSz28lqdITyJzk=; b=FeWo5lqquCjx/bq5vZUiGGIzUEzSYVKVmSHVOXBil0HLTEwVhgE7VEmcvZ2cODizBN u2mc6IVR26KZWoGP/LOYrfiLs1XrYRV0UaYCUmnlFLvsPBvKpRyNVHLys2Q7sBXQnEix cHGUFN3+hDEXoIbvcz432rIISll6PZxfkw9xMcNSqBCNE2vC+aXJIUE8hbCVUMV8gn2k 4lmPIYCfHQF/vkL5lUkoUBBqIBwzXAdWUSYgkKVGZ+ryZa4kLqCIjTfO8adtwEvP3Drr aCDLuvqLC4GxRC+U15KbA1sP/yJ4TUyK6iUhJAq0yVaRPoJqURQetuWO2B7o1zasp4dc OoVg== Received: by 10.52.26.7 with SMTP id h7mr1310673vdg.41.1345734077764; Thu, 23 Aug 2012 08:01:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.246.2 with HTTP; Thu, 23 Aug 2012 08:00:57 -0700 (PDT) In-Reply-To: <5035E003.1040606@kickstone.com> References: <50344D58.9010401@ringerc.id.au> <50347EBC.2090505@kickstone.com> <5034F837.7060103@ttc-cmc.net> <5035881A.5030805@ringerc.id.au> <5035E003.1040606@kickstone.com> From: Dave Cramer Date: Thu, 23 Aug 2012 11:00:57 -0400 X-Google-Sender-Auth: 9p_ErxkmzBpMDZ4R0mx0EvBkT6o Message-ID: Subject: Re: setObject(...) with native Java arrays like String[] ? To: John Lister Cc: pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201208/62 X-Sequence-Number: 23217 To be candid, I need help managing the patches. Many times the patches come in without test cases or without documentation. All of these things require me to spend time I don't have. Also many patches or requests are very specific "itches" which solve a particular problem for the submitter. Every new feature adds complexity and possibly negatively effects performance. It is useful to keep in mind that the driver is used by lots of other people who will not benefit from this particular feature request. So I am open to suggestions as to how to manage this better. I know that the main postgresql project has a system where other people review patches. This seems like it is a good idea. Notionally someone other than the submitter would review the patch. Thoughts ? Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On Thu, Aug 23, 2012 at 3:47 AM, John Lister wrote: > On 23/08/2012 02:32, Craig Ringer wrote: >> >> I don't remember seeing the patch, actually. >> >> http://www.postgresql.org/search/?m=1&q=John+Lister&l=19&d=365&s=d >> >> The Pg mailing list manager is irritatingly good at eating messages with >> attached patches, so it's possible nobody ever saw it. > > Odd, I remember getting the copy from the list, but not to worry, I've added > a couple of tests and waiting while they run, will then repost it. > > John > > > > -- > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-jdbc From john.lister@kickstone.com Thu Aug 23 18:09:01 2012 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4bq1-00088E-CG for pgsql-jdbc@postgresql.org; Thu, 23 Aug 2012 18:09:01 +0000 Received: from out1.ip05ir2.opaltelecom.net ([62.24.128.241]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4bpx-0002Q8-3i for pgsql-jdbc@postgresql.org; Thu, 23 Aug 2012 18:09:00 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApUBALxwNlBPS0U//2dsb2JhbAANOLcghlQBAQEBAzhAARALDgoJFg8JAwIBAgFFBg0BBwEBrgWUIIsIhxEDqEw X-IronPort-AV: E=Sophos;i="4.80,301,1344207600"; d="scan'208";a="391581154" Received: from 79-75-69-63.dynamic.dsl.as9105.com (HELO [192.168.6.20]) ([79.75.69.63]) by out1.ip05ir2.opaltelecom.net with ESMTP; 23 Aug 2012 19:08:53 +0100 Message-ID: <503671BC.7080204@kickstone.com> Date: Thu, 23 Aug 2012 19:09:00 +0100 From: John Lister User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Dave Cramer CC: pgsql-jdbc@postgresql.org Subject: Re: setObject(...) with native Java arrays like String[] ? References: <50344D58.9010401@ringerc.id.au> <50347EBC.2090505@kickstone.com> <5034F837.7060103@ttc-cmc.net> <5035881A.5030805@ringerc.id.au> <5035E003.1040606@kickstone.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.2 (-) X-Archive-Number: 201208/63 X-Sequence-Number: 23218 On 23/08/2012 16:00, Dave Cramer wrote: > To be candid, I need help managing the patches. > > Many times the patches come in without test cases or without > documentation. All of these things require me to spend time I don't > have. > > Also many patches or requests are very specific "itches" which solve a > particular problem for the submitter. Every new feature adds > complexity and possibly negatively effects performance. It is useful > to keep in mind that the driver is used by lots of other people who > will not benefit from this particular feature request. > > > So I am open to suggestions as to how to manage this better. I know > that the main postgresql project has a system where other people > review patches. This seems like it is a good idea. > > Notionally someone other than the submitter would review the patch. > Sounds like a good idea, I'm happy to review patches if required. Is there a set of guidelines that need to be followed in determining if a patch should be accepted? John From pg@fastcrypt.com Thu Aug 23 18:16:30 2012 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4bxG-00076M-Pc for pgsql-jdbc@postgresql.org; Thu, 23 Aug 2012 18:16:30 +0000 Received: from mail-vc0-f174.google.com ([209.85.220.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4bxF-0002Yk-6F for pgsql-jdbc@postgresql.org; Thu, 23 Aug 2012 18:16:30 +0000 Received: by vcbfk26 with SMTP id fk26so1159169vcb.19 for ; Thu, 23 Aug 2012 11:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=m/uBtZhlqddFSC3uthFPa05Fkai+vZD2C9VlGXbmfwo=; b=vvcTtdgzmIgwaJH9zr3GiDFOcmFrJxllAy/DZTnZhGTsXqhOIgObb4J2ChgVwGZ+vL w2aElEHTzPju8VUXCx3jdwGdwKMf1wRVgP3q1uEmqGZoDNZi3XZ32YPhiDw+gTZJqKXr cHdOl0zHvvSFaOuYVcrsvfE3r29bZ9JPVGVXCZg505uVrO/nFXo1EQBK0KsLwlxkIK9H wGEc3/6a4fROAZ6tGlInuDuVk2JmkGEf8n+LR0d5h2yREa5Je9OrW0UHl2HwL1GlwgW0 8wqCAAc9j2MW9bN/y8tsvIWcW49wPsdjE/Z1+NCuAKbAuC9IEE1wbhAUpG3HOwxruspF AkIQ== Received: by 10.58.35.141 with SMTP id h13mr2357933vej.11.1345745788226; Thu, 23 Aug 2012 11:16:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.246.2 with HTTP; Thu, 23 Aug 2012 11:16:08 -0700 (PDT) In-Reply-To: <503671BC.7080204@kickstone.com> References: <50344D58.9010401@ringerc.id.au> <50347EBC.2090505@kickstone.com> <5034F837.7060103@ttc-cmc.net> <5035881A.5030805@ringerc.id.au> <5035E003.1040606@kickstone.com> <503671BC.7080204@kickstone.com> From: Dave Cramer Date: Thu, 23 Aug 2012 14:16:08 -0400 X-Google-Sender-Auth: h-8GzCMkv5xBJvrnKdMPiO13AN0 Message-ID: Subject: Re: setObject(...) with native Java arrays like String[] ? To: John Lister Cc: pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201208/64 X-Sequence-Number: 23219 Well my personal guidelines would be as follows 1) Has to come with a test case 2) If it requires docs it needs those as well 3) Don't change the format of the code 4) Performance is important ( not sure exactly what that means ) Lastly how to determine if it is a good idea to accept it? I'd like to see more discussion from the group, voting would be one way. However as I said some very large companies use this as I said. Just because it satisfies your itch doesn't make it a good idea for everyone else. Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On Thu, Aug 23, 2012 at 2:09 PM, John Lister wrote: > On 23/08/2012 16:00, Dave Cramer wrote: >> >> To be candid, I need help managing the patches. >> >> Many times the patches come in without test cases or without >> documentation. All of these things require me to spend time I don't >> have. >> >> Also many patches or requests are very specific "itches" which solve a >> particular problem for the submitter. Every new feature adds >> complexity and possibly negatively effects performance. It is useful >> to keep in mind that the driver is used by lots of other people who >> will not benefit from this particular feature request. >> >> >> So I am open to suggestions as to how to manage this better. I know >> that the main postgresql project has a system where other people >> review patches. This seems like it is a good idea. >> >> Notionally someone other than the submitter would review the patch. >> > Sounds like a good idea, I'm happy to review patches if required. Is there a > set of guidelines that need to be followed > in determining if a patch should be accepted? > > John From ringerc@ringerc.id.au Fri Aug 24 02:23:13 2012 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4jYH-00016c-0g for pgsql-jdbc@postgresql.org; Fri, 24 Aug 2012 02:23:13 +0000 Received: from mail-iy0-f174.google.com ([209.85.210.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4jYF-0000l4-Vz for pgsql-jdbc@postgresql.org; Fri, 24 Aug 2012 02:23:12 +0000 Received: by ialo24 with SMTP id o24so2488138ial.19 for ; Thu, 23 Aug 2012 19:23:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=0qzzeZDawoUFbNvPtnu27BN8YhoW7LopeRo4KTm+td4=; b=Cqfj2VlgRzEPIPAEo5W9P3LBfat+7B+CHaBirSx/1ARyrpuA732ATUefydZAK4W0Lw G7gOHIKWGaBhlv0xAM1nCFonEreXpgr6JK8xG+24c2J+W9tY5XQSlIQeaGmuXhM8cjb3 vpeNx3eR8Wd4Wn9aRpyB2snZQUFQE1ND3/CyzEUa1rkfefbJ7N9KiVAOkFswB0hxRleH s2rrhuL+N8VDgmeV79+xIo+A0Sdsdm+qFMHLoz5NC72HScB8/VHCGIvIkKF52m7ErivW FNHb+Jb44CeOBVAtnRE6sFEDrCitBpOCdqwPu4lCGEtk75wrXhNTpqd/vOdXdPmhxIp4 fRQQ== Received: by 10.50.47.200 with SMTP id f8mr532714ign.6.1345774991239; Thu, 23 Aug 2012 19:23:11 -0700 (PDT) Received: from ayaki.localdomain (124-169-188-211.dyn.iinet.net.au. [124.169.188.211]) by mx.google.com with ESMTPS id gh2sm2804403igb.9.2012.08.23.19.23.08 (version=SSLv3 cipher=OTHER); Thu, 23 Aug 2012 19:23:10 -0700 (PDT) Message-ID: <5036E589.8060501@ringerc.id.au> Date: Fri, 24 Aug 2012 10:23:05 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Dave Cramer CC: John Lister , pgsql-jdbc@postgresql.org Subject: Re: setObject(...) with native Java arrays like String[] ? References: <50344D58.9010401@ringerc.id.au> <50347EBC.2090505@kickstone.com> <5034F837.7060103@ttc-cmc.net> <5035881A.5030805@ringerc.id.au> <5035E003.1040606@kickstone.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlQ1aGvXG6WIAXWY00ypjLT7Nwrd3JKX/QbhuWVm0+6awie/YOFAfSYU1bwSAsMunOcOYEn X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/66 X-Sequence-Number: 23221 On 08/23/2012 11:00 PM, Dave Cramer wrote: > To be candid, I need help managing the patches. > > Many times the patches come in without test cases or without > documentation. All of these things require me to spend time I don't > have. [snip] > Notionally someone other than the submitter would review the patch. > > Thoughts ? I've done enough Java and JDBC work now that I can do a half-decent job with PgJDBC patch review. I'm happy to help. It'd make sense to be able to manage patch review so it's easy to keep track of. I see two options for that: - Use the commitfest app, which fits the main server workflow but requires wrangling message-IDs and manual updates of the tracking that're sure to be forgotten; or - Use GitHub pull requests, which are much nicer to work with and more familiar to more people, but inconsistent with the main server's workflow. I don't see any sign that PgJDBC development has used the commitfest app recently, and there's no "PgJDBC" topic, only "Clients". Do you have a preference? Given the chance I'd *love* to work via GitHub. -- Craig Ringer From ringerc@ringerc.id.au Fri Aug 24 02:26:56 2012 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4jbs-00035Z-Io for pgsql-jdbc@postgresql.org; Fri, 24 Aug 2012 02:26:56 +0000 Received: from mail-iy0-f174.google.com ([209.85.210.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4jbr-0000pG-Ke for pgsql-jdbc@postgresql.org; Fri, 24 Aug 2012 02:26:56 +0000 Received: by ialo24 with SMTP id o24so2493200ial.19 for ; Thu, 23 Aug 2012 19:26:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=gke1Z9c9fw7zbAM8WINMf1hax95opUlgAJ4FWEAPMPo=; b=U7eSYlgqn2raj3kB5iCLGxh0W8o9xORdnUMr9lDyVakTEPBNx9PsG6mbG9e7KkZqzc AE12YruPs5PPv/W9KFNr34xlyS2ZYL3/q0fJ4c8gn5SwKZXjmnFi8oSQjD39dj2R/LOU PSqSc6xLA3BUgut4g+QfMHyrWKgd3H8OeNAt+8jCfXE9C+v7anwwaKTvpkjkkPLDxtiO ZrgCFrmLnoWQ3OMniduJWQaHMkEGX+Tt7lcg3yJAATjhlABaSrb0U1PZ3xsHLPmxU+2D KZz6LBgKSc0rjlXAlzvKpYVO9vdLtY0AKDhVxFWd6P0xj/WWOJxvIJqcv+tTyJswzDpd Epkg== Received: by 10.50.41.234 with SMTP id i10mr528249igl.8.1345775214887; Thu, 23 Aug 2012 19:26:54 -0700 (PDT) Received: from ayaki.localdomain (124-169-188-211.dyn.iinet.net.au. [124.169.188.211]) by mx.google.com with ESMTPS id d4sm2797125iga.14.2012.08.23.19.26.52 (version=SSLv3 cipher=OTHER); Thu, 23 Aug 2012 19:26:54 -0700 (PDT) Message-ID: <5036E669.5040806@ringerc.id.au> Date: Fri, 24 Aug 2012 10:26:49 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Dave Cramer CC: John Lister , pgsql-jdbc@postgresql.org Subject: Re: setObject(...) with native Java arrays like String[] ? References: <50344D58.9010401@ringerc.id.au> <50347EBC.2090505@kickstone.com> <5034F837.7060103@ttc-cmc.net> <5035881A.5030805@ringerc.id.au> <5035E003.1040606@kickstone.com> <503671BC.7080204@kickstone.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkFkfP1w/aju9bCQugKXi5F4p51m6oPdod5uGGWSy0A0t8UfEWsrJkOyivgHJzMTGHga1jO X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/67 X-Sequence-Number: 23222 On 08/24/2012 02:16 AM, Dave Cramer wrote: > Well my personal guidelines would be as follows > > 1) Has to come with a test case > 2) If it requires docs it needs those as well > 3) Don't change the format of the code > 4) Performance is important ( not sure exactly what that means ) > > Lastly how to determine if it is a good idea to accept it? I'd like to > see more discussion from the group, voting would be one way. > However as I said some very large companies use this as I said. Just > because it satisfies your itch doesn't make it a good idea for > everyone else. I'd want to add: - Doesn't break major existing users. A test suite that uses JPA and Hibernate and/or EclipseLink would make sense, and if I'm lucky I'll have time to work on that sometime in the next 100 years or so... - Improves or preserves the existing level of JDBC compliance. If it's nice but non-compliant, it IMO isn't acceptable. Same policy as the main server re SQL standards, really. - Fits within the existing JDBC interfaces and specs where possible; extensions should have to jump a higher bar. If it is an extension, it should mirror extensions from other drivers/vendors if possible. - Builds with Java 1.5 (ugh, but it'll be time for 1.6 soon). -- Craig Ringer