473,765 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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),ot k_value
varchar(255),ot k_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 ma*******@postg resql.org

Nov 23 '05 #1
2 2076

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),ot k_value
varchar(255),ot k_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),ot k_value
template1(# varchar(255),ot k_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

Nov 23 '05 #2
Mathias Picker <Ma************ @virtual-earth.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

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1707
by: Kelvin | last post by:
Hi: I have double d = 0.33 when I try to display this using: cout << d; it gives me 0.3329999999999999 i know it's caused by the way that computer stores float number... but how can i get exactly 0.33 without using printf like arguement ??
0
1396
by: Steve Wasser | last post by:
Hi. What am I doing wrong: foreach (DataRow dr1 in MyTable1.Rows) { reg = (float)dr1; prem = (float)dr1; die = (float)dr1; eth = (float)dr1; term = reg+prem+die+eth;
11
2280
by: Marc Pelletier | last post by:
Hello, I am having trouble implementing the following callback: CNCSError CECWCompressor::WriteReadLine(UINT32 nNextLine, void **ppInputArray) where ppInputArray is a 3 by x array. The length of x is not known at compile time.
2
1908
by: Daniel E. Fisher | last post by:
Running a RH 9 system with postgres 7.3.2-3 I come back after vacation and my system shutdown cause of a powerouttage on the block. I restart and i get this trying to access the database: "Warning: pg_connect() unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host database.lhasi.org and accepting TCP/IP connections on port 5432? in...
0
1773
by: Paramveer.Singh | last post by:
Hi! I was looking into the postgres error handling mechanism, and the documentation states that the present mechanism is primitive. I quote "whenever the parser, planner/optimizer or executor decide that a statement cannot be processed any longer, the whole transaction gets aborted and the system jumps back into the main loop to get the next command from the client application." Also, it states " it is possible that the database...
9
2371
by: Nicolas Blais | last post by:
Hi, I have this following class which I use as a timer: #include <sys/time.h> using namespace std; class chrono { public: chrono() {};
2
4217
by: progman | last post by:
Data Struct: from (string), to (string), rate (float) when i run this: cursor.executemany('insert into promo (`From`,`To`, `RATE`) \ values (%s,%s,%f)', ) i got this error: TypeError: float argument required
22
51553
by: ashkaan57 | last post by:
Hi, I am trying to put text on left and right side of the page and used: <div> <span>blah blah</span> <span style="float:right">blah blah</span> </div> The 2nd text does go to the right but the next line. What am I doing wrong? TIA.
3
1872
by: tader | last post by:
hi so my error is like this this is the script <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Div's</title> </head> <style type="text/css"> #main_box {
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.