Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 12:26 AM
Mathias Picker
Guest
 
Posts: n/a
Default postgres 7.4.2: float(20) results in error msg, but should not since7.4)

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/s...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

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

  #2  
Old November 23rd, 2005, 12:26 AM
Stephan Szabo
Guest
 
Posts: n/a
Default Re: postgres 7.4.2: float(20) results in error msg, but


On Sat, 3 Apr 2004, Mathias Picker wrote:
[color=blue]
> 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));"[/color]

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)


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

  #3  
Old November 23rd, 2005, 12:26 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: postgres 7.4.2: float(20) results in error msg, but should not since 7.4)

Mathias Picker <Mathias.Picker@virtual-earth.de> writes:[color=blue]
> My fresh postgres 7.4.2 install on a FreeBSD 5.2-CURRENT machine replies
> "ERROR: precision for FLOAT must be less than 16"[/color]

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

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles