public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jim Jones <[email protected]>
To: Chao Li <[email protected]>
Cc: David G. Johnston <[email protected]>
Cc: Greg Sabino Mullane <[email protected]>
Cc: Postgres hackers <[email protected]>
Subject: Re: ALTER TABLE: warn when actions do not recurse to partitions
Date: Thu, 22 Jan 2026 20:27:11 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAEoWx2mZsWnyS_XLDL5mL+yuU_g65p_tmHNesyfngqow7gtS3A@mail.gmail.com>
References: <CAEoWx2=SLga-xH09Cq_PAvsHhQHrBK+V0vF821JKgzS=Bm0haA@mail.gmail.com>
	<CAKFQuwZXt2dAuHFs6MtRCzfMP6YZFzssuzdW2woJBVmco=CDdQ@mail.gmail.com>
	<CAEoWx2nic2MaPUEKwb0Me1iwO3LsCf8wUHm55pjqaTRgJEZpcQ@mail.gmail.com>
	<CAKFQuwahxpPKT-LXGJ34BO5cVBUxFxzgNPTY8E_VW-cuNU_DkQ@mail.gmail.com>
	<CAEoWx2kQ9aSn-0LGPKc=woj+h-HR4uBV9TL20aeM3HzLmFqgFQ@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CAEoWx2mZsWnyS_XLDL5mL+yuU_g65p_tmHNesyfngqow7gtS3A@mail.gmail.com>

Hi Chao

On 22/01/2026 06:45, Chao Li wrote:
> evantest=# alter table p_test replica identity full, alter column
> username set (n_distinct = 0.1);
> NOTICE:  ALTER action REPLICA IDENTITY on relation "p_test" does not
> affect present partitions
> HINT:  partitions may be modified individually, or specify ONLY to
> suppress this message
> NOTICE:  ALTER action ALTER COLUMN ... SET on relation "p_test" does not
> affect present partitions
> HINT:  partitions may be modified individually, or specify ONLY to
> suppress this message
> ALTER TABLE


One could argue that encapsulating all conditions in
EmitPartitionNoRecurseNotice(), meaning it is called all the time, is
slightly inefficient, but the impact is really negligible in this case -
and it is how it is done in similar functions in tablecmds.c :) The code
LGTM.

One small thing:

errhint is supposed to be capitalised - see Error Message Style Guide[1]

"Detail and hint messages: Use complete sentences, and end each with a
period. Capitalize the first word of sentences. Put two spaces after the
period if another sentence follows (for English text; might be
inappropriate in other languages)."

ereport(NOTICE,
	errmsg("ALTER action %s on relation \"%s\" does not affect present
partitions",
		   action_str,
		   RelationGetRelationName(rel)),
	errhint("partitions may be modified individually, or specify ONLY to
suppress this message"));

What about this?

HINT: To update partitions, apply the command to each one individually,
or specify ONLY to suppress this message.

I'll test the newly covered subcomands tomorrow.

Best, Jim

1 - https://www.postgresql.org/docs/current/error-style-guide.html






view thread (19+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: ALTER TABLE: warn when actions do not recurse to partitions
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox