From: Álvaro Herrera <alvherre@kurilemu.de>
To: jian he <jian.universality@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Kirill Reshke <reshkekirill@gmail.com>
Subject: Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt
Date: Fri, 15 May 2026 16:04:52 +0200
Message-ID: <agcVPirhBaUg3iqo@alvherre.pgsql> (raw)
In-Reply-To: <CACJufxEs=DxDZ07xbUW_tYqJhdnoNf84UC1LzY6g+E58t19p3Q@mail.gmail.com>
On 2025-Dec-17, jian he wrote:
> diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
> index bc7adba4a0f..326d30cfb2f 100644
> --- a/src/include/nodes/parsenodes.h
> +++ b/src/include/nodes/parsenodes.h
> @@ -3551,6 +3551,10 @@ typedef struct CreateStatsStmt
> List *stat_types; /* stat types (list of String) */
> List *exprs; /* expressions to build statistics on */
> List *relations; /* rels to build stats on (list of RangeVar) */
> + List *from_clause; /* FROM clause ((list of RangeVar)) */
> + List *rtable; /* It’s not derived directly from the
> + * parser, instead it comes from parse
> + * analysis. (list of RangeTblEntry) */
> char *stxcomment; /* comment to apply to stats, or NULL */
> bool transformed; /* true when transformStatsStmt is finished */
> bool if_not_exists; /* do nothing if stats name already exists */
I'm unconvinced about this, and I wonder if it would make sense to have
two separate nodes, one which is pre-transform (direct out of parser)
and another which is post-transform. Would that things a bit simpler?
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"We have labored long to build a heaven, only (Prof. Milton Glass)
to find it populated with horrors" (Watchmen, Alan Moore)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@kurilemu.de, jian.universality@gmail.com, peter@eisentraut.org, tgl@sss.pgh.pa.us, reshkekirill@gmail.com
Subject: Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt
In-Reply-To: <agcVPirhBaUg3iqo@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox