Re: Why is AccessShareLock held until end of transaction? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Why is AccessShareLock held until end of transaction?
Date
Msg-id 30114.1394509266@sss.pgh.pa.us
Whole thread Raw
In response to Why is AccessShareLock held until end of transaction?  (Joe Conway <mail@joeconway.com>)
Responses Re: Why is AccessShareLock held until end of transaction?
List pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> I am probably missing something obvious, but why does the
> AccessShareLock remain held on a table after a SELECT statement is
> complete when in a transaction block?

*Any* lock acquired by user command is held till end of transaction;
AccessShareLock isn't special.

In general, releasing early would increase the risk of undesirable
behaviors such as tables changing definition mid-transaction.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [bug fix] pg_ctl always uses the same event source
Next
From: Amit Kapila
Date:
Subject: Re: issue log message to suggest VACUUM FULL if a table is nearly empty