Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:
> Yes, and holding a row exclusive lock must imho at least grab a shared
> table lock
As indeed it does. Our disagreement seems to be just on the point of
whether it's safe to allow a read-only transaction to release its
AccessShareLock locks partway through.
My opinion about that is colored by the known bugs that we have because
the parser/rewriter/planner currently do just that. You can cause the
system to become mighty confused if the report of a table schema change
arrives partway through the parse/plan process, because decisions
already made are no longer valid. While we can probably patch the holes
in this area by holding a lock throughout processing of one statement,
I think that will just push the problem up to the application level.
How many apps are likely to be coded in a way that will be robust
against intra-transaction schema changes?
regards, tom lane