Wrong argument name in error message from attribute_stats functions

Поиск
Список
Период
Сортировка
Искать

Wrong argument name in error message from attribute_stats functions

От:
Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
Дата:
Вложения:
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/

Re: Wrong argument name in error message from attribute_stats functions

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Fri, Jul 10, 2026 at 9:11 PM Ilia Evdokimov
 wrote:
>
> 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`.

Thanks for the patch! LGTM.

Regards,

-- 
Fujii Masao


Re: Wrong argument name in error message from attribute_stats functions

От:
Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
Дата:
On 7/10/26 15:32, Fujii Masao wrote:

> On Fri, Jul 10, 2026 at 9:11 PM Ilia Evdokimov
>  wrote:
>> 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`.
> Thanks for the patch! LGTM.

Since Beta 2 is scheduled for July 16, it might be worth getting this 
fixed before then. Incorrect error messages can mislead users during 
debugging.

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



Re: Wrong argument name in error message from attribute_stats functions

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Mon, Jul 13, 2026 at 10:20 PM Ilia Evdokimov
 wrote:
> >> In v1-patch I propose naming these the same way `pg_proc.dat` does, i.e.
> >> `schemaname` and `relname`.
> > Thanks for the patch! LGTM.

I've pushed the patch and backpatched it to v18,
where pg_clear_attribute_stats() was introduced. Thanks!


> Since Beta 2 is scheduled for July 16, it might be worth getting this
> fixed before then. Incorrect error messages can mislead users during
> debugging.

Although we're still before the v19 beta2 release, the beta2 tag has
already been created, so this fix won't make it into beta2. It will be
included in the next v19 beta or RC release, as well as the next
minor releases.

Regards,

-- 
Fujii Masao


FAQ