Bracket, brace, parenthesis
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2021-05-14T06:31:53Z
Lists: pgsql-hackers
Attachments
- brace_not_bracket.patch (text/x-patch) patch
I found the following code in multirangetypes.c
> if (*ptr == '{')
> ptr++;
> else
> ereport(ERROR,
> (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
> errmsg("malformed multirange literal: \"%s\"",
> input_str),
> errdetail("Missing left bracket.")));
I'm not sure how much we (or people) are strcit on the distinction
between the $SUBJECT, isn't '{' a brace generally?
postgres=# select '[1,3]'::int4multirange;
ERROR: malformed multirange literal: "[1,3]"
LINE 1: select '[1,3]'::int4multirange;
^
DETAIL: Missing left bracket.
The distinction is significant there. It should at least be "Missing
left curly bracket." or "Missing left brace." (or left curly brace..?)
'{' is mentioned as "curly brackets" in comments of the soruce file.
It is mentioned as "brace" in regexp doc [1]. And.. uh.. I found the
world "curly braces" in the doc for conding conventions..
[1]: https://www.postgresql.org/docs/devel/functions-matching.html
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center
Commits
-
Improve some error wording with multirange type parsing
- 12cc956664f1 14.0 landed