public inbox for [email protected]  
help / color / mirror / Atom feed
Clarification on the (lack of) differences between the decimal, dec, and numeric types
2+ messages / 2 participants
[nested] [flat]

* Clarification on the (lack of) differences between the decimal, dec, and numeric types
@ 2026-02-12 21:06  PG Doc comments form <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Doc comments form @ 2026-02-12 21:06 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/datatype-numeric.html
Description:

I would like to clarify the language describing the decimal type on this
page: https://www.postgresql.org/docs/current/datatype-numeric.html

The above page states that "The types decimal and numeric are equivalent."
Although this is correct, it is not precise enough. Several questions have
been asked online about the difference between the types, even though there
is no difference. decimal and dec are both aliases to the numeric type. Any
calls to decimal or dec are the same thing as calls to numeric.

I suggest changing the wording of the page to read "decimal is an alias of
the type numeric. Both reference the same underlying type."

This answer on StackOverflow explains the full details:
https://stackoverflow.com/a/79888387/9542182.






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Clarification on the (lack of) differences between the decimal, dec, and numeric types
@ 2026-02-12 22:45  David G. Johnston <[email protected]>
  parent: PG Doc comments form <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: David G. Johnston @ 2026-02-12 22:45 UTC (permalink / raw)
  To: [email protected] <[email protected]>; [email protected] <[email protected]>

On Thursday, February 12, 2026, PG Doc comments form <[email protected]>
wrote:
>
>
> I suggest changing the wording of the page to read "decimal is an alias of
> the type numeric. Both reference the same underlying type."
>

I agree with the premise but would likely use a bit different wording and
also tweak the table at the top of the page.  I’m disliking the idea of
calling something a data type if it doesn’t appear in pg_type; syntax
aliases should be called out for what they are.  A nearby complaint
regarding nchar, which is also an alias but isn’t mentioned, informs this.
I do wonder what other “data type” aliases should be considered.

David J.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-02-12 22:45 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-02-12 21:06 Clarification on the (lack of) differences between the decimal, dec, and numeric types PG Doc comments form <[email protected]>
2026-02-12 22:45 ` David G. Johnston <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox