Home > Net >  How to specify ONLY 'scale' for 'numeric' type in PostgreSQL?
How to specify ONLY 'scale' for 'numeric' type in PostgreSQL?

Time:09-24

In PostgreSQL in order to specify 'scale' for a 'numeric' type I must specify it like this:

NUMERIC(precision, scale)

So I must specify precision as well. PostgreSQL docs say that:

Note: The maximum allowed precision when explicitly specified in the type declaration is 1000;

Is there a way to specify only 'scale' and leave 'precision' as default?

CodePudding user response:

There is no way to specify only the scale, but you can get the same effect if you explicitly specify the precision as the maximum allowed value 1000:

NUMERIC(1000,27)
  • Related