Search Postgresql Archives

Re: Column information

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

 



On 05/04/2017 07:29 AM, Tom Lane wrote:
Adrian Klaver <adrian.klaver@xxxxxxxxxxx> writes:
On 05/04/2017 07:00 AM, Tom Lane wrote:
No, certainly not.  The radix column says what the units of measurement
are, not that the values in the precision column aren't decimal.  So radix
2 indicates that precision 32 means "32 bits", not "32 decimal digits".

Alright now I am confused:

https://www.postgresql.org/docs/9.6/static/infoschema-columns.html

"numeric_precision 	cardinal_number 	

If data_type identifies a numeric type, this column contains the
(declared or implicit) precision of the type for this column. The
precision indicates the number of significant digits. It can be
expressed in decimal (base 10) or binary (base 2) terms, as specified in
the column numeric_precision_radix. For all other data types, this
column is null.
"

I'm not here to defend the wording in our documentation ;-)

Perhaps this would be clearer if it said "measured in ... digits" rather
than "expressed in ... terms"?

It should probably also say "identifies a numeric type of restricted
precision", since for example it'll be null for a column that's
NUMERIC but has no typmod.

Alright I see that, but why does my example show a numeric_precision_radix of 10?

Is there some transition point where it goes from base 10 to base 2?

Also why does the OPs query show anything when the data_type is integer?


			regards, tom lane



--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[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