Re: EXPLAIN ANALYZE CREATE TABLE AS EXECUTE runs non-SELECT prepared statements

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: EXPLAIN ANALYZE CREATE TABLE AS EXECUTE runs non-SELECT prepared statements
Date: 2026-12-01 15:52:40
Message-ID: CAHGQGwGhDj6=tbJT3bc9ZZ+H4=u2x7wBJJ65D3RyCK=XvPLRuA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 20, 2026 at 2:01 PM Bertrand Drouvot
<bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
> Agreed, that's an oversight in 9dbf2b7d75d. The fix is pretty straightforward
> and looks good to me.

+1

One minor comment is: the following checks seem redundant:

+SELECT count(*) FROM ctas_exec_src;
+SELECT relname FROM pg_class
+ WHERE relname IN ('ctas_exec_tbl', 'ctas_exec_inner');

Similar error cases in select_into.sql don't check the resulting database
state either. So I'm thinking to remove these checks and commit the patch,
barring any objections.

Regards,

--
Fujii Masao

Attachment Content-Type Size
v2-0001-Reject-non-SELECT-statements-in-EXPLAIN-CREATE-TA.patch application/octet-stream 4.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hüseyin Demir 2026-12-01 16:16:11 Re: [PATCH] Report changes discarded for relations not in the subscription
Previous Message Nathan Bossart 2026-12-01 15:46:23 Re: Should we add timing output to pg_upgrade?