pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Radosław Smogura <rsmogura@softperience.eu>
To: Lukas Eder <lukas.eder@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: UDT arrays
Date: Thu, 10 Feb 2011 11:26:00 +0100
Message-ID: <201102101126.00740.rsmogura@softperience.eu> (raw)
In-Reply-To: <AANLkTinQrs7UiJSUEL2k+LMfVkmcEYSM0Bro5HQoQRvN@mail.gmail.com>
References: <68ad45f0-460b-4483-a4df-13b69777707f@s18g2000vbe.googlegroups.com>
	<201102091029.28960.rsmogura@softperience.eu>
	<AANLkTinQrs7UiJSUEL2k+LMfVkmcEYSM0Bro5HQoQRvN@mail.gmail.com>

I plan to sleep PGObjects, and wake for backward compatibility (maybe as 
deprectaed or some parts of methodes there - there are static methods, which 
causes problems with JDBC4 Exception model and some per connection specific 
functionaly). Arrays parsing is different in text and in binary mode, and 
binary mode requires more carefull casting. Actually current flow should allow 
to read any nested type, which is supported by ResultSet, form parent object 
(I putted only exception for getting result set with multidimensional arrays).

I plan to give support for specific PG objects like box, but make them more 
portable, without internal connection with JDBC dirver logic (you should be 
able to serialize and deserialzie those objects on clients without 
postgresql.jar). I plan as well to give "plugable" support for custom PG 
objects, which can't be processed as UDT (above box is example). I think about 
mapping some PG objects to standard Java classes e.g. PG's box -> java.awt.Box 
(but this is far future). Above must be done in descriptive way, to be usable 
with DataSource and app servers, eg.

@Resource
private DataSource myPgDataSourceWithMyCustomObjects

Both of those should be designed in fast way, low memory consuption and in way 
preventing writing thousend lines of code if binary format for given object 
will be different per DB level or per new protocol (see e.g. problems with 
bytea encoding in 9.x releases).

Lukas Eder <lukas.eder@gmail.com> Thursday 10 February 2011 10:45:17
> Hi Radoslaw,
> 
> Interesting news about SQLData, Input & Output. That's clearly the way to
> go. So I assume you're going to be removing the PGobject from the JDBC
> driver in a future release? But I still don't understand whether you are
> actually going to plan to implement a combination of UDT and ARRAY, such as
> 
> CREATE TYPE composite_type AS (f1 int, f2 text);
> CREATE TABLE t (array_of_composites composite_type[]);
> 
> This works in Postgres, but is not supported by the JDBC driver... Are you
> going to address that as well, in the near future?
> 
> Cheers
> Lukas
> 
> 2011/2/9 Radosław Smogura <rsmogura@softperience.eu>
> 
> > Actully I've done support for Structs, with fixation of metdata bugs for
> > those
> > types (JDBC spec is not clear, about metadata), but only in binary mode.
> > I will, probably, don't give support for text protocol, because I belive
> > binary
> > protocol is future (but here is ?).
> > 
> > Currently
> > 1. I need to give full support for SQLData, Input & Output, as well
> > implement
> > last type (time with timezone).
> > 2. I need do something with DISTINCTS/DOMAINS
> > 
> > Problem is with timestamap with timezone, as on this field backend is
> > incompatible with JDBC, so probably driver will need to extend database,
> > or I
> > need to do some "unsafe" operations or throw exception for some
> > situations.
> > 
> > In both of this I need to do / write full tests for many compilations of
> > resultset/arrays/structs.
> > 
> > Some functionality will temporaly go away (eg. updating result sets,
> > arrays returning result sets for mulitdimensional array, geometric
> > types, and all PG*Objects will be sleeped too).
> > 
> > I want to resolve some serius bugs about resultsets and SQLXML, too,
> > before release (this with result set may wait, if only one person found
> > it, and not
> > even found full problem...), but SQLXML is important as XML is popular
> > solution.
> > 
> > Maybe "true" async notifications based on listener pattern will be
> > included in
> > release.
> > 
> > Have a nice day
> > 
> > Lukas Eder <lukas.eder@gmail.com> Tuesday 08 February 2011 00:26:58
> > 
> > > Hello,
> > > 
> > > I was wondering, is JDBC driver support for the combination of UDT's
> > > and arrays planned for the near future? I couldn't find any
> > > documentation on the JDBC drivers website.
> > > 
> > > Is there any specific reason (apart from the fact that UDT's and/or
> > > ARRAYs are not used often) for this lack of implementation? Clearly,
> > > the database itself supports this combination. I can easily insert and
> > > select data from a table holding UDT arrays
> > > 
> > > Cheers
> > > Lukas



view thread (10+ messages)  latest in thread

Message-ID: <201102101126.00740.rsmogura@softperience.eu>
Permalink:  ../201102101126.00740.rsmogura@softperience.eu/
Also on:    postgresql.org/message-id/201102101126.00740.rsmogura@softperience.eu

 · 

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: rsmogura@softperience.eu, lukas.eder@gmail.com
  Subject: Re: UDT arrays
  In-Reply-To: <201102101126.00740.rsmogura@softperience.eu>
  References: <68ad45f0-460b-4483-a4df-13b69777707f@s18g2000vbe.googlegroups.com> <201102091029.28960.rsmogura@softperience.eu> <AANLkTinQrs7UiJSUEL2k+LMfVkmcEYSM0Bro5HQoQRvN@mail.gmail.com> <201102101126.00740.rsmogura@softperience.eu>

* 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