Wrong argument name in error message from attribute_stats functions - Mailing list pgsql-hackers

From Ilia Evdokimov
Subject Wrong argument name in error message from attribute_stats functions
Date
Msg-id 4bf66c5e-8dd7-4ef3-8691-db67ecff6f16@tantorlabs.com
Whole thread
Responses Re: Wrong argument name in error message from attribute_stats functions
List 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

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: use of SPI by postgresImportForeignStatistics
Next
From: Fujii Masao
Date:
Subject: Re: Wrong argument name in error message from attribute_stats functions