Re: [GENERAL] Column information - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] Column information
Date
Msg-id 8198.1493909089@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Column information  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: [GENERAL] Column information  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> 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?

In PG, "numeric" always has radix 10, because the underlying
implementation is decimal, and all other numerical types such as int and
float have radix 2, because the underlying implementation is binary.
Other DBMSses could perhaps do it differently.

Hmm ... you could argue that numeric_precision_radix is telling you
something about the type's arithmetic behavior independently of what
the particular column's maximum-precision-if-any is.  That's not how
the SQL spec defines it, but that's really what it's doing.

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

The point is that our integers are 32-bit integers, not some other size.
If you try it on bigint or smallint columns, you'll get other answers.

            regards, tom lane


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] Column information
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] Column information