pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vit Timchishin <tivvpgsqljdbc@gtech-ua.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Synthesize support for Statement.getGeneratedKeys()?
Date: Mon, 22 Jan 2007 15:58:50 +0200
Message-ID: <45B4C31A.7060304@gtech-ua.com> (raw)
In-Reply-To: <EFC27EC0-3877-4F9C-AEDC-FDAD1D6C306F@fastcrypt.com>
References: <4580E681.3080106@kensystem.com>
	<45810230.80803@gmx.at>
	<45B1AC19.3090300@kensystem.com>
	<45B1F839.3060402@gmx.at>
	<45B254D7.4080304@kensystem.com>
	<55027648-0777-4BE4-8581-933E86180539@fastcrypt.com>
	<45B3B9CB.3070308@kensystem.com>
	<3C6B3C20-CD94-4D35-B146-27DA78E6E462@fastcrypt.com>
	<45B40AE1.8020003@kensystem.com>
	<B480E0B4-9CE7-4FA3-B6F2-BC912AF2BC58@fastcrypt.com>
	<45B44726.1070301@kensystem.com>
	<45B480E6.2010009@gmx.at>
	<EFC27EC0-3877-4F9C-AEDC-FDAD1D6C306F@fastcrypt.com>

Hello.

I have few thoughts I'd like to share. Everything below is my IMHO.
First of all, parsing input DDL (or requiring protocol support) is
needed to get full support for all range of DDLS. But now PostgreSQL
does not support this feature for any DLLs.
Then you can always detect is the support is needed on the first user
call - depending on which function is called to prepare/execute the
statement.
Why don't you want to do the next:
For

PreparedStatement <http://java.sun.com/javase/6/docs/api/java/sql/PreparedStatement.html; *prepareStatement*(String <http://java.sun.com/javase/6/docs/api/java/lang/String.html; sql,
                                   int[] columnIndexes)
                                   throws SQLException <http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html;

(ans similar Statement call)
simply call sql + " RETURNING *"
and then filter out column indexes
Of course, this won't handle the case when statement already contains
RETURNING, cases for non-INSERT and so on (I am not an expert to
describe all possible cases).
But now NO cases are working and this change will make some work
properly and I, personally, don't see a problem in others giving some
other error message (say, incorrect SQL text for statements already
containing RETURNING) then they are doing now.
When the protocol will be changed (extended), you can use that but what
does prevent you to implement the most widely used (as for me) case,
given it will be implemented properly?





view thread (50+ messages)  latest in thread

Message-ID: <45B4C31A.7060304@gtech-ua.com>
Permalink:  ../45B4C31A.7060304@gtech-ua.com/
Also on:    postgresql.org/message-id/45B4C31A.7060304@gtech-ua.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: tivvpgsqljdbc@gtech-ua.com
  Subject: Re: Synthesize support for Statement.getGeneratedKeys()?
  In-Reply-To: <45B4C31A.7060304@gtech-ua.com>
  References: <4580E681.3080106@kensystem.com> <45810230.80803@gmx.at> <45B1AC19.3090300@kensystem.com> <45B1F839.3060402@gmx.at> <45B254D7.4080304@kensystem.com> <55027648-0777-4BE4-8581-933E86180539@fastcrypt.com> <45B3B9CB.3070308@kensystem.com> <3C6B3C20-CD94-4D35-B146-27DA78E6E462@fastcrypt.com> <45B40AE1.8020003@kensystem.com> <B480E0B4-9CE7-4FA3-B6F2-BC912AF2BC58@fastcrypt.com> <45B44726.1070301@kensystem.com> <45B480E6.2010009@gmx.at> <EFC27EC0-3877-4F9C-AEDC-FDAD1D6C306F@fastcrypt.com> <45B4C31A.7060304@gtech-ua.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