pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ken Johanson <pg-user@kensystem.com>
To: Kris Jurka <books@ejurka.com>
To: pgsql-general@postgresql.org
Subject: Re: RETURNING clause: how to specifiy column indexes?
Date: Thu, 13 Dec 2007 00:17:37 -0700
Message-ID: <4760DC91.8090103@kensystem.com> (raw)
In-Reply-To: <Pine.BSO.4.64.0712130149270.6192@leary.csoft.net>
References: <22a9f7570703301215y44a937d0r5faa706bad7948c@mail.gmail.com>
	<4610AA0C.30608@ejurka.com>
	<47579D44.6060005@kensystem.com>
	<47579FBE.1070503@kensystem.com>
	<475F7766.2040005@kensystem.com>
	<12796.1197439644@sss.pgh.pa.us>
	<Pine.BSO.4.64.0712120138360.1768@leary.csoft.net>
	<4760D33E.40004@kensystem.com>
	<Pine.BSO.4.64.0712130149270.6192@leary.csoft.net>

> 
>> If true, my next idea would be to derive the column name using a 
>> subquery in the returning clause. But it sounds like this may have 
>> potential security contraints (will any INSERT query always have read 
>> access to the PG tables?). And no guarantee of the order matching in 
>> the long term.
> 
> There is no requirement that insert permission on a user table implies 
> read access to pg_catalog.  Still many clients will break if they can't 
> read pg_catalog.  For example, all of the JDBC driver's MetaData results 
> need to query pg tables, updatable ResultSets need to query pg tables to 
> know what the primary key is and so on.  So if this functionality 
> required access to pg_catalog that would neither be unprecedented nor 
> unreasonable.
> 

So it sounds like this may be the best approach, do you agree? I'll try 
and find the cycles to code this up although the limited value of 
getGeneratedKeys by index makes me think my time would be better spent 
elsewhere on the JDBC driver. For now at least. If you can respond to my 
earlier query (5 Dec) about what robustness improvements are needed, 
I'll start there..

Thanks,
Ken





view thread (11+ messages)  latest in thread

Message-ID: <4760DC91.8090103@kensystem.com>
Permalink:  ../4760DC91.8090103@kensystem.com/
Also on:    postgresql.org/message-id/4760DC91.8090103@kensystem.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: pg-user@kensystem.com, books@ejurka.com, pgsql-general@postgresql.org
  Subject: Re: RETURNING clause: how to specifiy column indexes?
  In-Reply-To: <4760DC91.8090103@kensystem.com>
  References: <22a9f7570703301215y44a937d0r5faa706bad7948c@mail.gmail.com> <4610AA0C.30608@ejurka.com> <47579D44.6060005@kensystem.com> <47579FBE.1070503@kensystem.com> <475F7766.2040005@kensystem.com> <12796.1197439644@sss.pgh.pa.us> <Pine.BSO.4.64.0712120138360.1768@leary.csoft.net> <4760D33E.40004@kensystem.com> <Pine.BSO.4.64.0712130149270.6192@leary.csoft.net> <4760DC91.8090103@kensystem.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