agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix argument names in pg_clear_attribute_stats() errors
Date: Wed, 15 Jul 2026 12:26:08 +0000
Message-ID: <E1wjygh-000IaI-0Y@gemulon.postgresql.org> (raw)

Fix argument names in pg_clear_attribute_stats() errors

pg_clear_attribute_stats() checks its required arguments manually
because the function is not strict. Previously, when schemaname or
relname was passed as NULL, the error incorrectly reported the
argument name as "relation" in both cases:

    ERROR:  argument "relation" must not be null

This was misleading, especially for schemaname, and inconsistent with
the function's SQL-visible argument names.

The cause is that cleararginfo[] in attribute_stats.c used
"relation" for both the schema-name and relation-name arguments.

This commit fixes the issue by using "schemaname" and "relname" instead,
matching the function's declared argument names so that the error reports
the correct argument name.

Backpatch to v18, where pg_clear_attribute_stats() was introduced.

Author: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/4bf66c5e-8dd7-4ef3-8691-db67ecff6f16@tantorlabs.com
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/173ea84dfdc96390ce37a3918aa660a15c4734a9

Modified Files
--------------
src/backend/statistics/attribute_stats.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1wjygh-000IaI-0Y@gemulon.postgresql.org>
Permalink:  ../E1wjygh-000IaI-0Y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wjygh-000IaI-0Y@gemulon.postgresql.org

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-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix argument names in pg_clear_attribute_stats() errors
  In-Reply-To: <E1wjygh-000IaI-0Y@gemulon.postgresql.org>

* 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