diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-17 23:12:36 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-17 23:12:36 +0000 |
commit | eab5d643b2b2ec7cbf2b524b10b964aa6f273f54 (patch) | |
tree | 73cea76cb74f35283f30714e01747ce87d60f219 /src/backend/parser | |
parent | 596652d6eb35411781dcac07809375f83d501cf1 (diff) | |
download | postgresql-eab5d643b2b2ec7cbf2b524b10b964aa6f273f54.tar.gz postgresql-eab5d643b2b2ec7cbf2b524b10b964aa6f273f54.zip |
Make FLOAT(p) measure the precision p in bits, not decimal digits, to
match the SQL standard. Document FLOAT and FLOAT(p) notations in
datatype.sgml. Per recent pghackers discussion.
Diffstat (limited to 'src/backend/parser')
-rw-r--r-- | src/backend/parser/gram.y | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ec2f3316091..f8958d58783 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.416 2003/05/29 20:40:36 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.417 2003/06/17 23:12:36 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -5051,8 +5051,8 @@ GenericType: /* SQL92 numeric data types * Check FLOAT() precision limits assuming IEEE floating types. - * Provide real DECIMAL() and NUMERIC() implementations now - Jan 1998-12-30 * - thomas 1997-09-18 + * Provide real DECIMAL() and NUMERIC() implementations now - Jan 1998-12-30 */ Numeric: INT_P { @@ -5107,14 +5107,14 @@ opt_float: '(' Iconst ')' { if ($2 < 1) elog(ERROR, - "precision for FLOAT must be at least 1"); - else if ($2 < 7) + "precision for FLOAT must be at least 1 bit"); + else if ($2 <= 24) $$ = SystemTypeName("float4"); - else if ($2 < 16) + else if ($2 <= 53) $$ = SystemTypeName("float8"); else elog(ERROR, - "precision for FLOAT must be less than 16"); + "precision for FLOAT must be less than 54 bits"); } | /*EMPTY*/ { |