Re: Querying one partition in a function takes locks on all partitions - Mailing list pgsql-general

From Tom Lane
Subject Re: Querying one partition in a function takes locks on all partitions
Date
Msg-id 4115257.1743441667@sss.pgh.pa.us
Whole thread Raw
In response to Re: Querying one partition in a function takes locks on all partitions  (Renan Alves Fonseca <renanfonseca@gmail.com>)
List pgsql-general
Renan Alves Fonseca <renanfonseca@gmail.com> writes:
> There is a Note that says: "The entire body of an SQL function is
> parsed before any of it is executed. While an SQL function can contain
> commands that alter ..."

Yup.

> If I understood well [2], then both notes may be discarded together in
> the next version.

No, that aspect is not changed in the currently-proposed patch:
we still do parse analysis of all the queries at the beginning.
I'd like to make it work differently eventually, but with feature
freeze so close I do not think that'll happen for v18.

Thinking a bit more about that, if the initial parse analysis succeeds
then the patched code will in fact re-parse before execution if any
DDL changes have occurred.  So you get at least some of the desired
behavioral change.  But the example given in the docs would still
fail, so I don't feel a need to change the docs yet.

            regards, tom lane



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Querying one partition in a function takes locks on all partitions
Next
From: Eden Aharoni
Date:
Subject: Re: [EXTERNAL] Re: RDS IO Read time