Re: [PATCH] Avoid open and lock the table Extendend Statistics (src/backend/commands/statscmds.c)

From: Andres Freund <andres(at)anarazel(dot)de>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Avoid open and lock the table Extendend Statistics (src/backend/commands/statscmds.c)
Date: 2022-02-13 21:43:17
Message-ID: 20220213214317.qhroocro46ligj6w@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-02-13 18:21:38 -0300, Ranier Vilela wrote:
> Why open and lock the table Extended Statistics if it is not the owner.
> Check and return to avoid this.

I was about to say that this opens up time-to-check-time-to-use type
issues. But it's the wrong thing to lock to prevent those.

Having looked briefly at it, I don't understand what the locking scheme is?
Shouldn't there be at least some locking against concurrent ALTERs and between
ALTER and ANALYZE etc?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikolay Shaplov 2022-02-13 21:43:36 [PATCH] New [relation] option engine
Previous Message Justin Pryzby 2022-02-13 21:42:13 Re: Adding CI to our tree