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