Re: BUG #17139: Invalid input syntax for uuid (politely this time!)

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: anton(dot)melser(at)outlook(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17139: Invalid input syntax for uuid (politely this time!)
Date: 2021-08-10 13:48:55
Message-ID: CAKFQuwbq2EBgdrm2ctX4r+1cBYt7OCS49FwppPDu+sRtsXDnnQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Aug 10, 2021 at 5:46 AM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:

> ...
> ERROR: invalid input syntax for type uuid:
> "{dec3d6c4-c32e-45c6-000-1eae3df44fbf}"
> LÍNEA 1: insert into users values ('{dec3d6c4-c32e-45c6-000-1eae3df44...
> ^
> HINT: Valid UUID values are of the form
> 'FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF'.
> ...
>
> Though he pointed out some issues with this, which are definitely valid
> ones.

> However, I still think there might be a way to suggest that there is
> something wrong with the *value*,

It says: ERROR: invalid input syntax for type uuid:

Aside from the lack of the literal word "value" it seems to meet your
criteria quite well Both the "input" and "type uuid" point the reader to
the value as opposed to the statement.

rather than what most naive SQL users like
> myself assume when talking about the syntax,

I'm unconvinced that this is a valid representation of reality. Even if
"syntax error" by itself refers to the SQL 99% of the time if I tell people
that 'ABC'::integer is a syntax error for type integer they are not likely
to think the SQL part of the query is wrong. You can argue that it's more
natural to say "invalid input value" but I suspect that because the input
is not just a simple value but also contains its own structural elements
(the brackets) that syntax was the chosen term. I do not find that to be a
wrong choice.

> The aforementioned bug
> report was the only thing that got me looking at the actual value I was
> trying to query.
>
>
Yes, the community is considered a valid resource to lean on in our
design. We do not try to cover every possible misconception people may
have and expect that through discussions with real people things will work
out. I did make a single suggestion in that previous thread, pointing out
the length difference explicitly, that would be a marginal improvement, but
no one volunteered to write the patch and it isn't something worth pushing
or figuring out how to do myself (at least then, I may give it a try at
some point...).

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-08-10 15:51:23 Re: information_schema.constraint_column_usage shows wrong table name
Previous Message PG Bug reporting form 2021-08-10 09:50:05 BUG #17139: Invalid input syntax for uuid (politely this time!)