Re: Precision and scale of numeric column reported as value

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Precision and scale of numeric column reported as value
Дата
Msg-id 15199.1111618002@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Precision and scale of numeric column reported as value  (Oliver Jowett <oliver@opencloud.com>)
Список 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 по дате отправления:

Предыдущее
От: Roy Badami
Дата:
Сообщение: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Следующее
От: Roy Badami
Дата:
Сообщение: Re: BUG #1517: SQL interval syntax is accepted by the parser,