pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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: Thu, 13 Nov 2025 09:24:52 +0100
Message-ID: <202511130823.vppi3clyjl4r@alvherre.pgsql> (raw)
In-Reply-To: <CACJufxHJ4xXM_svKE3y3=cdsKuM1Ke4PXY0K=xZcCmWw4sjwBQ@mail.gmail.com>

On 2025-Nov-13, jian he wrote:

> @@ -15658,10 +15658,19 @@ ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId, char *cmd,
>  			querytree_list = list_concat(querytree_list, afterStmts);
>  		}
>  		else if (IsA(stmt, CreateStatsStmt))
> +		{
> +			RangeTblEntry 	*rte;
> +			CreateStatsStmt *ss = castNode(CreateStatsStmt, stmt);
> +
> +			rte = makeNode(RangeTblEntry);
> +			rte->rtekind = RTE_RELATION;
> +			rte->relid = oldRelId;
> +			rte->rellockmode = ShareUpdateExclusiveLock;
> +			ss->rtable = list_make1(rte);
> +
>  			querytree_list = lappend(querytree_list,
> -									 transformStatsStmt(oldRelId,
> -														(CreateStatsStmt *) stmt,
> -														cmd));
> +									 transformStatsStmt(ss, cmd));
> +		}
>  		else
>  			querytree_list = lappend(querytree_list, stmt);
>  	}

Hmm, how would this part here work in the hypothetical world where a
stats object references multiple relations?

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"No renuncies a nada. No te aferres a nada."





view thread (33+ messages)  latest in thread

Message-ID: <202511130823.vppi3clyjl4r@alvherre.pgsql>
Permalink:  ../202511130823.vppi3clyjl4r@alvherre.pgsql/
Also on:    postgresql.org/message-id/202511130823.vppi3clyjl4r@alvherre.pgsql

 · 

reply

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: <202511130823.vppi3clyjl4r@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