Re: postgres 7.4.2: float(20) results in error msg, but should not since 7.4)

Lists: pgsql-general
From: Mathias Picker <Mathias(dot)Picker(at)virtual-earth(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: postgres 7.4.2: float(20) results in error msg, but should not since 7.4)
Date: 2004-04-03 12:54:40
Message-ID: 406EB410.8070400@virtual-earth.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

While trying to install the roundup issue tracking system I discovered
the following - faulty - behaviour:

My fresh postgres 7.4.2 install on a FreeBSD 5.2-CURRENT machine replies

"ERROR: precision for FLOAT must be less than 16"

to

"create table otks (otk_key varchar(255),otk_value
varchar(255),otk_time float(20));"

Now http://www.postgresql.org/docs/7.4/static/datatype.html#DATATYPE-FLOAT
says

"PostgreSQL accepts float(1) to float(24) as selecting the real type,
while float(25) to float(53) select double precision."

and

"Note: Prior to PostgreSQL 7.4, the precision in float(p) was taken to
mean so many decimal digits. This has been corrected to match the SQL
standard, which specifies that the precision is measured in binary digits."

So it should work, I guess. Are there any switches to alter this
behaviour, or is this a bug??

Thanks, Mathias


From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Mathias Picker <Mathias(dot)Picker(at)virtual-earth(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postgres 7.4.2: float(20) results in error msg, but
Date: 2004-04-03 15:08:34
Message-ID: 20040403070730.K57536@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


On Sat, 3 Apr 2004, Mathias Picker wrote:

> While trying to install the roundup issue tracking system I discovered
> the following - faulty - behaviour:
>
> My fresh postgres 7.4.2 install on a FreeBSD 5.2-CURRENT machine replies
>
> "ERROR: precision for FLOAT must be less than 16"
>
> to
>
> "create table otks (otk_key varchar(255),otk_value
> varchar(255),otk_time float(20));"

It appears to work for me on a just compiled 7.4.2 under Redhat 8:

template1=# create table otks (otk_key varchar(255),otk_value
template1(# varchar(255),otk_time float(20));
CREATE TABLE
template1=# select version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 7.4.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2
20020903 (Red Hat Linux 8.0 3.2-7)
(1 row)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mathias Picker <Mathias(dot)Picker(at)virtual-earth(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postgres 7.4.2: float(20) results in error msg, but should not since 7.4)
Date: 2004-04-03 18:38:51
Message-ID: 17210.1081017531@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Mathias Picker <Mathias(dot)Picker(at)virtual-earth(dot)de> writes:
> My fresh postgres 7.4.2 install on a FreeBSD 5.2-CURRENT machine replies
> "ERROR: precision for FLOAT must be less than 16"

This is certainly pilot error: you are talking to a 7.3 or earlier
server. 7.4's corresponding error message isn't even spelt the same.

regards, tom lane