Re: Concurrently updating an updatable view - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject Re: Concurrently updating an updatable view
Date
Msg-id 4648D0E5.5020608@tpf.co.jp
Whole thread Raw
In response to Re: Concurrently updating an updatable view  (Richard Huxton <dev@archonet.com>)
Responses Re: Concurrently updating an updatable view  (Richard Huxton <dev@archonet.com>)
List pgsql-hackers
Richard Huxton wrote:
> Heikki Linnakangas wrote:
>> The problem is that the new tuple version is checked only against the 
>> condition in the update rule, id=OLD.id, but not the condition in the 
>> original update-claus, dt='a'.
>>
>> Yeah, that's confusing :(.
> 
> Bit more than just normal rule confusion I'd say. Try the following two 
> statements in parallel (assuming you've just run the previous):
> 
> UPDATE test SET dt='c';
> UPDATE test SET dt='x' FROM test t2 WHERE test.id=t2.id AND t2.dt='b';
> 
> This isn't a problem with the view mechanism - it's a problem with 
> re-checking clauses involving subqueries or joins I'd guess.

I don't understand the PostgreSQL specific *FROM* clause correctly.
Currently the relations in the *FROM* clause seem to be read only
and UPDATE operations seem to acquire no tuple level lock on them.

regards,
Hiroshi Inoue


pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Use of ActiveSnapshot
Next
From: Richard Huxton
Date:
Subject: Re: Concurrently updating an updatable view