Обсуждение: [BUGS] BUG #14786: Wrong Precision with money datatype

Поиск
Список
Период
Сортировка

[BUGS] BUG #14786: Wrong Precision with money datatype

От
nithinkrishna.p@gmail.com
Дата:
The following bug has been logged on the website:

Bug reference:      14786
Logged by:          Nithin Krishna
Email address:      nithinkrishna.p@gmail.com
PostgreSQL version: 9.4.5
Operating system:   Windows 2008 R2 Standard Edition
Description:

Hi,

I have a table created in postgres database with money datatype. I have
connected to the database via SQuirrel SQL Client and found that the
precision of the money datatype is shown as 2147483647. But from the
postgres documentation the precision and scale should be 19 and 2
respectively. I am using postgres driver jar postgresql-9.4-1203.jdbc42.jar
and database version is 9.4.5


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

Re: [BUGS] BUG #14786: Wrong Precision with money datatype

От
"David G. Johnston"
Дата:
On Mon, Aug 21, 2017 at 1:04 AM, <nithinkrishna.p@gmail.com> wrote:
The following bug has been logged on the website:

Bug reference:      14786
Logged by:          Nithin Krishna
Email address:      nithinkrishna.p@gmail.com
PostgreSQL version: 9.4.5
Operating system:   Windows 2008 R2 Standard Edition
Description:

Hi,

I have a table created in postgres database with money datatype. I have
connected to the database via SQuirrel SQL Client and found that the
precision of the money datatype is shown as 2147483647. But from the
postgres documentation the precision and scale should be 19 and 2
respectively. I am using postgres driver jar postgresql-9.4-1203.jdbc42.jar
and database version is 9.4.5

How/where did you observe this 2147483647 number?​

David J.

Re: [BUGS] BUG #14786: Wrong Precision with money datatype

От
Tom Lane
Дата:
nithinkrishna.p@gmail.com writes:
> I have a table created in postgres database with money datatype. I have
> connected to the database via SQuirrel SQL Client and found that the
> precision of the money datatype is shown as 2147483647. But from the
> postgres documentation the precision and scale should be 19 and 2
> respectively.

You're reading something into the documentation that's not there.
Postgres doesn't have an explicit notion of precision and scale
for type money; those concepts are specific to type numeric.
I think the information_schema views will present made-up, hard-wired
values for the float and integer types as well, but they don't for
money, since its range is locale-dependent.
        regards, tom lane


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