Re: query_id, pg_stat_activity, extended query protocol - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: query_id, pg_stat_activity, extended query protocol
Date
Msg-id CAKFQuwYyMAg9O4zG-JEf17aJhV2y5wQ=-kDv3xMmzenptPqVTA@mail.gmail.com
Whole thread Raw
In response to Re: query_id, pg_stat_activity, extended query protocol  ("Imseih (AWS), Sami" <simseih@amazon.com>)
Responses Re: query_id, pg_stat_activity, extended query protocol
List pgsql-hackers
On Sat, Apr 27, 2024 at 6:55 AM Imseih (AWS), Sami <simseih@amazon.com> wrote:

Hmm, you raise a good point. Isn't this a fundamental problem
with prepared statements? If there is DDL on the
relations of the prepared statement query, shouldn't the prepared
statement be considered invalid at that point and raise an error
to the user?


We choose a arguably more user-friendly option:

"""
Although the main point of a prepared statement is to avoid repeated parse analysis and planning of the statement, PostgreSQL will force re-analysis and re-planning of the statement before using it whenever database objects used in the statement have undergone definitional (DDL) changes or their planner statistics have been updated since the previous use of the prepared statement.
"""

David J.

pgsql-hackers by date:

Previous
From: "Imseih (AWS), Sami"
Date:
Subject: Re: query_id, pg_stat_activity, extended query protocol
Next
From: "Imseih (AWS), Sami"
Date:
Subject: Re: query_id, pg_stat_activity, extended query protocol