Re: AW: AW: AW: relation ### modified while in use - Mailing list pgsql-hackers

From Tom Lane
Subject Re: AW: AW: AW: relation ### modified while in use
Date
Msg-id 8375.972311791@sss.pgh.pa.us
Whole thread Raw
In response to AW: AW: AW: relation ### modified while in use  (Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>)
List pgsql-hackers
Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:
> No, the above is not a valid example, because Session 2 won't
> get the exclusive lock until Session 1 commits, since Session 1 already 
> holds a lock on foo (for the inserted row). 

> You were talking about the "select only" case (and no for update eighter). 
> I think that select statements need a shared lock for the duration of their 
> execution only.

You seem to think that locks on individual tuples conflict with
table-wide locks.  AFAIK that's not true.  The only way to prevent
another xact from gaining AccessExclusiveLock on a table is to be
holding some lock *on the table*.

As for your claim that read-only xacts don't need to worry about
preventing schema updates, what of adding/deleting ON SELECT rules?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: testing my connection to list.
Next
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql/src/test/regress/expected (plpgsql.out inet.out foreign_key.out errors.out)