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: 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, 29 Aug 2025 14:48:21 +0200
Message-ID: <202508291248.qnqtditzyqm2@alvherre.pgsql> (raw)
In-Reply-To: <CACJufxFcvo=fM6J9RC88n1U=eS9+5QdftwUNQMu5h7OgjmqDwQ@mail.gmail.com>

On 2025-Aug-29, jian he wrote:

> On Fri, Aug 29, 2025 at 5:46 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> > WFM, although I think you could shorten it to "tables, materialized
> > views, and foreign tables".  We generally expect that partitioned
> > tables are included when saying "tables", no?  I'm not dead set on
> > that either way, though.
> 
> https://www.postgresql.org/docs/current/sql-copy.html
> use "COPY TO can be used only with plain tables, not views, and does
> not copy rows from child tables or child partitions"

I'm inclined to think that we should only mention partitioned tables
specifically when they for some reason deviate from what we do for
regular tables, i.e., what Tom is saying.  I don't think we've had an
explicit, consistent rule for that thus far, so there may be places
where we fail to follow it.

Anyway, I have pushed the error message change.

> > Alternatively, maybe the right fix is to move the parse-analysis
> > work into CreateStatistics altogether.  I think there is not a
> > very good argument for ProcessUtilitySlow doing all that stuff.
> > It's supposed to mainly just be a dispatching switch(), IMO.
>
> seems doable.
> transformStatsStmt, CreateStatistics both used only twice, refactoring
> arguments should be fine.
> please check the attached POC, regress tests also added.

Yeah, I like how this turned out.  I found out this was introduced in
commit a4d75c86bf15.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/





view thread (33+ messages)  latest in thread

Message-ID: <202508291248.qnqtditzyqm2@alvherre.pgsql>
Permalink:  ../202508291248.qnqtditzyqm2@alvherre.pgsql/
Also on:    postgresql.org/message-id/202508291248.qnqtditzyqm2@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, tgl@sss.pgh.pa.us, reshkekirill@gmail.com
  Subject: Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt
  In-Reply-To: <202508291248.qnqtditzyqm2@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