Bracket, brace, parenthesis

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Bracket, brace, parenthesis
Date: 2021-05-14 06:31:53
Message-ID: 20210514.153153.1814935914483287479.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
brace_not_bracket.patch text/x-patch 924 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-05-14 06:54:51 Re: Added missing tab completion for alter subscription set option
Previous Message Bharath Rupireddy 2021-05-14 06:31:15 Re: Support for VACUUMing Foreign Tables