Re: RETURNING clause: how to specifiy column indexes?

From: Ken Johanson <pg-user(at)kensystem(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: RETURNING clause: how to specifiy column indexes?
Date: 2007-12-13 07:17:37
Message-ID: 4760DC91.8090103@kensystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

>
>> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lew 2007-12-13 07:18:02 Re: Hijack!
Previous Message Joshua D. Drake 2007-12-13 07:08:35 Re: Slow PITR restore

Browse pgsql-jdbc by date

  From Date Subject
Next Message Altaf Malik 2007-12-13 15:24:57 JDBC causing the connection to close after executing a COPY command
Previous Message Kris Jurka 2007-12-13 07:05:57 Re: Synthesize support for Statement.getGeneratedKeys()?