Wrong argument name in error message from attribute_stats functions

From: Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Wrong argument name in error message from attribute_stats functions
Date: 2026-07-10 12:11:17
Message-ID: 4bf66c5e-8dd7-4ef3-8691-db67ecff6f16@tantorlabs.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While using pg_clear_attribute_stats() I noticed weird printing:

```
CREATE TABLE t(a int);
SELECT pg_clear_attribute_stats(NULL, 't', 'a', false);
ERROR:  argument "relation" must not be null
```

NULL was passed for `schemaname`, not for a `relation` argument. This
comes from cleararginfo[], where both the schema and relname entries are
labeled `relation`.

In v1-patch I propose naming these the same way `pg_proc.dat` does, i.e.
`schemaname` and `relname`.

After applying patch:
```
SELECT pg_clear_attribute_stats(NULL, 't', 'a', false);
ERROR:  argument "schemaname" must not be null

SELECT pg_clear_attribute_stats('public', NULL, 'a', false);
ERROR:  argument "relname" must not be null
```

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/

Attachment Content-Type Size
v1-0001-Wrong-argument-name-in-error-message-from-attribu.patch text/x-patch 1014 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-07-10 12:32:32 Re: Wrong argument name in error message from attribute_stats functions
Previous Message Fujii Masao 2026-07-10 12:09:46 Re: use of SPI by postgresImportForeignStatistics