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

Поиск
Список
Период
Сортировка
Искать
От
rob stone
Тема
Re: [GENERAL] How to define the limit length for numeric type?
Дата
Msg-id
1489354133.8887.1.camel@gmail.com
Ответ на
Список
Дерево обсуждения
[GENERAL] How to define the limit length for numeric type? vod vos <vodvos@zoho.com>
Re: [GENERAL] How to define the limit length for numeric type? "Charles Clavadetscher" <clavadetscher@swisspug.org>
Re: [GENERAL] How to define the limit length for numeric type? rob stone <floriparob@gmail.com>
Re: [GENERAL] How to define the limit length for numeric type? vod vos <vodvos@zoho.com>
Re: [GENERAL] How to define the limit length for numeric type? "Charles Clavadetscher" <clavadetscher@swisspug.org>
Re: [GENERAL] How to define the limit length for numeric type? "David G. Johnston" <david.g.johnston@gmail.com>
Re: [GENERAL] How to define the limit length for numeric type? Christoph Moench-Tegeder <cmt@burggraben.net>
Re: [GENERAL] How to define the limit length for numeric type? Pavel Stehule <pavel.stehule@gmail.com>
Re: [GENERAL] How to define the limit length for numeric type? vod vos <vodvos@zoho.com>
Re: [GENERAL] How to define the limit length for numeric type? "Charles Clavadetscher" <clavadetscher@swisspug.org>
Re: [GENERAL] How to define the limit length for numeric type? vod vos <vodvos@zoho.com>
Re: [GENERAL] How to define the limit length for numeric type? Adrian Klaver <adrian.klaver@aklaver.com>
Re: [GENERAL] How to define the limit length for numeric type? "David G. Johnston" <david.g.johnston@gmail.com>
Re: [GENERAL] How to define the limit length for numeric type? Tom Lane <tgl@sss.pgh.pa.us>
Re: [GENERAL] How to define the limit length for numeric type? Pavel Stehule <pavel.stehule@gmail.com>
Re: [GENERAL] How to define the limit length for numeric type? "David G. Johnston" <david.g.johnston@gmail.com>
Hello,

On Sat, 2017-03-11 at 22:14 -0800, vod vos wrote:
> Hi everyone,
> 
> How to define the exact limit length of numeric type? For example, 
> 
> CREATE TABLE test  (id serial, goose numeric(4,1));
> 
> 300.2 and 30.2 can be inserted into COLUMN goose, but I want 30.2 or
> 3.2 can not be inserted, how to do this?
> 
> Thank you.
> 
> 
> 


Assuming that column goose may only contain values ranging from 100.0
to 999.9, then a check constraint along the lines of:-

goose > 99.9 and < 1000

should do the trick.

HTH,
Rob

В списке pgsql-general по дате отправления
От:
Дата:
Сообщение: [GENERAL] general erros backup
От: Raffaele Irlanda
Дата:
FAQ