Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 13, 2017 at 7:51 AM, vod vos <vodvos@xxxxxxxx> 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.​

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux