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 CAKFQuwY13e6xHZAnB7r53GExarsOJqgR=4fbaN8Qj5ECwyYk6g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] How to define the limit length for numeric type?  (vod vos <vodvos@zoho.com>)
Список pgsql-general
On Mon, Mar 13, 2017 at 7:51 AM, vod vos <vodvos@zoho.com> wrote:
Sorry for taking varchar(4) as an example, What I want urgently is how to make a constraint of fixed length of a numeric data,
that you can only input data like 23.45,  and if you input the data like 2.45, 23.4356, 233.45, you will get a warning
message from postgresql.

I think expr will do the job, but are there any simpler ways to do it in postgresql?

​Requiring a fixed length, and not an amount range is unusual.  That the only way to do it is to consider the input as text and use a regular expression is understandable.

David J.​

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

Предыдущее
От: "Charles Clavadetscher"
Дата:
Сообщение: Re: [GENERAL] How to define the limit length for numeric type?
Следующее
От: Schmid Andreas
Дата:
Сообщение: [GENERAL] createuser: How to specify a database to connect to