Re: [GENERAL] How to define the limit length for numeric type?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [GENERAL] How to define the limit length for numeric type?
Дата
Msg-id CAKFQuwbygDxCBnVgAWdF=mzO70PM6uUiLCQJgkdNV0QhfCUB3w@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] How to define the limit length for numeric type?  (vod vos <vodvos@zoho.com>)
Список pgsql-general
On Sat, Mar 11, 2017 at 11:14 PM, vod vos <vodvos@zoho.com> wrote:

Hi everyone,

How to define the exact limit length of numeric type? For example,

CREATE TABLE test  (id serial, goose numeric(4,1));

​[...]
 30.2 can be inserted into COLUMN goose, but I want 30.2
​[...]
 can not be inserted, how to do this?

​Not possible to both allow and disallow the same value (30.2) ...

A check constraint is "how" you define additional limitation on the data - but you'll need to figure out where the logic flaw (or typo) came from.


David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: [GENERAL] How to define the limit length for numeric type?
Следующее
От: vod vos
Дата:
Сообщение: Re: [GENERAL] How to define the limit length for numeric type?