pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jao@geophile.com
To: pgsql-jdbc@postgresql.org
Subject: Array support in 8.1 JDBC driver
Date: Tue, 28 Mar 2006 12:09:22 -0500
Message-ID: <20060328120922.j4j45ztgsgc4go40@geophile.com> (raw)

I am using postgres 7.4 with an 8.1 JDBC driver. I am considering
whether I should use postgres arrays, and a key issue is JDBC support.
I found this comment about the 7.4 driver from Oliver Jowett
(http://archives.postgresql.org/pgsql-jdbc/2004-11/msg00141.php):

    The driver does not really support setArray() / updateArray() for
    arbitary Array implementations. I had a patch to fix this ages ago but
    it has rotted since then, and was never really the right way to do it
    anyway.

The 8.1 release notes for dev307 say this, which seems to imply
better support:

    Fix setArray when using the v3 protocol. We can't bind arrays as text,
    we need the correct type. This gets the array type from the
    Array.getBaseType method. This is a fragile means that depends on a
    specific Array implementation, but we already depend on a very
    specific implementation (toString() returning a correctly formatted pg
    array) that we can live with this. (oliver)

I'm not sure I understand this. It sounds like the array is converted
to a string. Is the string then just pasted into the query?  What does
this to to the use of server-side prepared statements? I'd like to
avoid parsing the "same" statement repeatedly due to the use of
arrays.

Or is the string then somehow used to bind an array to the prepared
statement?

I don't have to use postgres array, and if the driver will introduce
lots of string manipulation, I'll probably do something else.

Jack Orenstein





view thread (2+ messages)  latest in thread

Message-ID: <20060328120922.j4j45ztgsgc4go40@geophile.com>
Permalink:  ../20060328120922.j4j45ztgsgc4go40@geophile.com/
Also on:    postgresql.org/message-id/20060328120922.j4j45ztgsgc4go40@geophile.com

 · 

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: jao@geophile.com
  Subject: Re: Array support in 8.1 JDBC driver
  In-Reply-To: <20060328120922.j4j45ztgsgc4go40@geophile.com>
  References: <20060328120922.j4j45ztgsgc4go40@geophile.com>

* 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