Re: Precision and scale of numeric column reported as value - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Precision and scale of numeric column reported as value
Date
Msg-id 15199.1111618002@sss.pgh.pa.us
Whole thread Raw
In response to Re: Precision and scale of numeric column reported as value  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-bugs
Oliver Jowett <oliver@opencloud.com> writes:
> There appears to be no default, which is why we currently return -1.

The spec's notion of a "default precision and scale" is that every
numeric column has a specific precision and scale --- ie, is physically
fixed-width --- and everything you store into it will be coerced to that
precision and scale.  Postgres doesn't do it that way, which is why the
notion of a default is a bit meaningless.

> Scale should default to 0 per the standard, but defaults to whatever the
> precision is in PostgreSQL (see the docs for details).

If you specify a precision only, we do assume scale 0 to go with it.
It's only the case of an unconstrained numeric column that we depart
from the spec for.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Roy Badami
Date:
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Next
From: Roy Badami
Date:
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,