Ought binary literals to allow spaces?

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Ought binary literals to allow spaces?
Date: 2020-02-23 17:24:00
Message-ID: 5E52B530.5040900@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

ISO seems to allow spaces among the digits of a binary literal, so as
to group them for readability, as in X'00ba b10c'. We seem not to.
(The B'...' form appears to be a PostgreSQL extension, but I imagine
if ISO had it, it would allow spaces too.)

Is it worthwhile to allow that? Or to add a compatibility note somewhere
around sql-syntax-bit-strings saying we don't allow it?

For comparison, byteain does allow grouping whitespace.

It seems that byteain allows arbitrary whitespace (tabs, newlines, etc.),
whereas ISO's X'...' allows exactly and only U+0020 space characters.

Whitespace for byteain must occur between digit pairs; spaces in X'...'
per ISO can be anywhere.

Regards,
-Chap

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-02-23 20:58:18 Re: Yet another fast GiST build
Previous Message Vladimir Sitnikov 2020-02-23 12:14:25 Re: Error on failed COMMIT