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