Re: PQftable insufficient for primary key determination

From: Kris Jurka <books(at)ejurka(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michal Maruška <mmc(at)maruska(dot)dyndns(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: PQftable insufficient for primary key determination
Date: 2004-07-16 18:18:49
Message-ID: Pine.BSO.4.56.0407161305370.26415@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 16 Jul 2004, Tom Lane wrote:

> I don't think this is a well-defined problem. What does the user think
> he's doing when he edits yyy of the join output? There may be multiple
> copies of that value in the output table, if the row that it came from
> joined to multiple rows in the other tables. In that case it would be
> impossible to alter a single field value without changing other rows of
> the displayed result. So at least in the general case, I don't think
> it makes sense to allow editing of fields of join results.

I agree, but something that would be nice along these lines is the ability
to detect if the results from a user provided query are from a join. For
example the JDBC driver supports updatable ResultSets and right now the
detection code to determine if a given query can be updated involves a
very broken inspection of the query string. I was thinking this could be
done by checking the source tables of the result. At the moment this
can't tell if a self join is involved. It would also have problems in
a situation where a join was performed but only columns from one table
were selected. Allowing an update here could affect multiple rows of the
result, but still should only affect one source row. I don't like this
idea, but I don't have any better ideas than trying to implement a full
sql parser in the JDBC driver. Perhaps this will have to wait for
updatable cursors.

Kris Jurka

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Parker 2004-07-16 18:48:39 Re: moving an installation
Previous Message Jean-Luc Lachance 2004-07-16 17:01:00 Re: Column as result of subtraction of two other columns?