Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, Noah Misch <noah(at)leadboat(dot)com>, Jason Petersen <jason(at)citusdata(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Subject: Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
Date: 2017-05-12 14:28:10
Message-ID: d75c4198-8cf0-e344-22a9-bcbc19a2dc76@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 5/11/17 17:28, Andres Freund wrote:
> Isn't that pretty much the point? The whole open_share_lock()
> optimization looks like it really only can make a difference with
> subtransactions?

Yeah that confused me too. That keep-the-lock-for-the-whole-transaction
logic was introduced in a2597ef17958e75e7ba26507dc407249cc9e7134 around
7.3, way before subtransactions (8.0). The point there was apparently
just to avoid hitting the lock manager on subsequent calls. That code
has since been moved around end refactored many times. When
subtransactions were introduced, the current logic of keeping the lock
across subtransactions was added in order to keep the original intent.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2017-05-12 14:35:56 Re: [HACKERS] Concurrent ALTER SEQUENCE RESTART Regression
Previous Message Tom Lane 2017-05-12 14:20:47 Re: BUG #14648: counts for queries using array unnesting is incorrect

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-05-12 14:30:58 Re: Is there any way to access heap_open() from _PG_init ??
Previous Message Neha Khatri 2017-05-12 14:27:14 Re: If subscription to foreign table valid ?