The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/sql-syntax-lexical.html
Description:

Hi,

Re. Docs page:
https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS-NUMERIC

I noticed that the following are specified as valid numeric constants:

1_500_000_000
0b10001000_00000000
0o_1_755
0xFFFF_FFFF
1.618_034

So I'd expect something like:

SELECT 1.618_034;

...to return 1.618034? But instead I get 1.618.

And:

SELECT 1_500_000_000::text;

...results in a: ERROR: syntax error at or near "::"

Which seems at odds to what the docs say:
"For visual grouping, underscores can be inserted between digits. These have
no further effect on the value of the constant."

I'm left not really understanding how to use _ in numerical constants?

Tim

Reply via email to