pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedExample numeric constants aren't valid?
3+ messages / 3 participants
[nested] [flat]
* Example numeric constants aren't valid?
@ 2023-10-06 19:49 PG Doc comments form <noreply@postgresql.org>
2023-10-09 10:37 ` Re: Example numeric constants aren't valid? Vik Fearing <vik@postgresfriends.org>
0 siblings, 1 reply; 3+ messages in thread
From: PG Doc comments form @ 2023-10-06 19:49 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: tim.needham2@gmail.com
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Example numeric constants aren't valid?
2023-10-06 19:49 Example numeric constants aren't valid? PG Doc comments form <noreply@postgresql.org>
@ 2023-10-09 10:37 ` Vik Fearing <vik@postgresfriends.org>
2023-10-09 10:38 ` Re: Example numeric constants aren't valid? Tim Needham <tim.needham2@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Vik Fearing @ 2023-10-09 10:37 UTC (permalink / raw)
To: tim.needham2@gmail.com; pgsql-docs@lists.postgresql.org
On 10/6/23 20:49, PG Doc comments form wrote:
>
> I'm left not really understanding how to use _ in numerical constants?
You are reading the documentation for 16, but you are using 14 or lower.
If you want this functionality, you need to upgrade your server.
--
Vik Fearing
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Example numeric constants aren't valid?
2023-10-06 19:49 Example numeric constants aren't valid? PG Doc comments form <noreply@postgresql.org>
2023-10-09 10:37 ` Re: Example numeric constants aren't valid? Vik Fearing <vik@postgresfriends.org>
@ 2023-10-09 10:38 ` Tim Needham <tim.needham2@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Tim Needham @ 2023-10-09 10:38 UTC (permalink / raw)
To: Vik Fearing <vik@postgresfriends.org>; +Cc: pgsql-docs@lists.postgresql.org
Oh goodness, sorry Vik.
On Mon, Oct 9, 2023 at 11:37 AM Vik Fearing <vik@postgresfriends.org> wrote:
> On 10/6/23 20:49, PG Doc comments form wrote:
> >
> > I'm left not really understanding how to use _ in numerical constants?
>
> You are reading the documentation for 16, but you are using 14 or lower.
> If you want this functionality, you need to upgrade your server.
> --
> Vik Fearing
>
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2023-10-09 10:38 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-10-06 19:49 Example numeric constants aren't valid? PG Doc comments form <noreply@postgresql.org>
2023-10-09 10:37 ` Vik Fearing <vik@postgresfriends.org>
2023-10-09 10:38 ` Tim Needham <tim.needham2@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox