Re: Extended Statistics set/restore/clear functions.
| От | Michael Paquier |
|---|---|
| Тема | Re: Extended Statistics set/restore/clear functions. |
| Дата | |
| Msg-id | aRwGeN7o22HJclg5@paquier.xyz обсуждение исходный текст |
| Ответ на | Re: Extended Statistics set/restore/clear functions. (jian he <jian.universality@gmail.com>) |
| Ответы |
Re: Extended Statistics set/restore/clear functions.
|
| Список | pgsql-hackers |
On Tue, Nov 18, 2025 at 01:07:23PM +0800, jian he wrote:
> + errsave(parse->escontext,
> + errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
> + errmsg("malformed pg_ndistinct: \"%s\"", parse->str),
> + errdetail("Invalid \"%s\" value.",
> + PG_NDISTINCT_KEY_NDISTINCT));
>
> the errdetail is way too generic?
> similar to ``select 'a'::int;``
> we can
> DETAIL: Invalid input syntax for type integer: "a"
> HINT: "ndistinct" value expected to be a type of integer.
>
> what do you think?
That is intentional, as it is intentional to not show the value of the
token in such cases. This will be mostly used for the import
functions, so I am not sure that it is worth spending time on tuning
all these error cases that one is most likely not going to see as the
main scenarios are going to be through pg_dump/restore, most of the
time in the scope of an upgrade.
> SELECT '[{"attributes" : [2,3], "ndistinct" : 4, "ndistinct" :
> 14}]'::pg_ndistinct;
> pg_ndistinct
> -------------------------------------------
> [{"attributes": [2, 3], "ndistinct": 14}]
>
> SELECT '[{"attributes" : [2,3], "ndistinct" : 4, "attributes" :
> []}]'::pg_ndistinct;
> pg_ndistinct
> ------------------------------------------
> [{"attributes": [2, 3], "ndistinct": 4}]
>
> Is the above output what we expected?
Interesting one. The extra "attributes" should not be required once
we have one set, indeed.
--
Michael
Вложения
В списке pgsql-hackers по дате отправления: