Re: Revised Patch to allow multiple table locks in "Unison" - Mailing list pgsql-patches

From Tom Lane
Subject Re: Revised Patch to allow multiple table locks in "Unison"
Date
Msg-id 345.996954696@sss.pgh.pa.us
Whole thread Raw
In response to Re: Revised Patch to allow multiple table locks in "Unison"  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Revised Patch to allow multiple table locks in "Unison"  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Patch applied.

Idly looking this over again, I noticed a big OOPS:

>> !         freeList(lockstmt->rellist);

>> !         pfree(relname);

>> !             pfree(relname);

It is most definitely NOT the executor's business to release pieces of
the querytree; this will certainly break plpgsql functions, for example,
where the same querytree is executed repeatedly.
Bruce, please remove those lines.

Another thing I am concerned about now that I look more closely is that
the multi-rel case code opens the relations without any lock, and then
assumes they'll stick around while it opens and access-checks the rest.
This will fail if someone else drops one of the rels meanwhile.  I think
the entire routine should be reduced to a simple loop that opens, locks,
and closes the rels one at a time.  The extra code bulk to do it this
way isn't buying us anything at all.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Small patch for Hurd
Next
From: Bruce Momjian
Date:
Subject: Re: Revised Patch to allow multiple table locks in "Unison"