pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: dmp <danap@ttc-cmc.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: setObject(...) with native Java arrays like String[] ?
Date: Thu, 23 Aug 2012 09:32:10 +0800
Message-ID: <5035881A.5030805@ringerc.id.au> (raw)
In-Reply-To: <5034F837.7060103@ttc-cmc.net>
References: <50344D58.9010401@ringerc.id.au>
	<50347EBC.2090505@kickstone.com>
	<5034F837.7060103@ttc-cmc.net>

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




view thread (14+ messages)  latest in thread

Message-ID: <5035881A.5030805@ringerc.id.au>
Permalink:  ../5035881A.5030805@ringerc.id.au/
Also on:    postgresql.org/message-id/5035881A.5030805@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: ringerc@ringerc.id.au, danap@ttc-cmc.net
  Subject: Re: setObject(...) with native Java arrays like String[] ?
  In-Reply-To: <5035881A.5030805@ringerc.id.au>
  References: <50344D58.9010401@ringerc.id.au> <50347EBC.2090505@kickstone.com> <5034F837.7060103@ttc-cmc.net> <5035881A.5030805@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox