Re: query_id, pg_stat_activity, extended query protocol

From: "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>
To: Andrei Lepikhov <lepihov(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: kaido vaikla <kaido(dot)vaikla(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: query_id, pg_stat_activity, extended query protocol
Date: 2024-04-27 13:54:57
Message-ID: 0FBCAA35-1200-41CA-8371-881141E1D7C6@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> But simplistic case with a prepared statement shows how the value of
> queryId can be changed if you don't acquire all the objects needed for
> the execution:

> CREATE TABLE test();
> PREPARE name AS SELECT * FROM test;
> EXPLAIN (ANALYSE, VERBOSE, COSTS OFF) EXECUTE name;
> DROP TABLE test;
> CREATE TABLE test();
> EXPLAIN (ANALYSE, VERBOSE, COSTS OFF) EXECUTE name;

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?

Regards,

Sami

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2024-04-27 14:18:57 Re: query_id, pg_stat_activity, extended query protocol
Previous Message Masahiko Sawada 2024-04-27 13:04:33 Re: New committers: Melanie Plageman, Richard Guo