decimal & numeric report bug
От | José Soares |
---|---|
Тема | decimal & numeric report bug |
Дата | |
Msg-id | 3767A88D.A06E9097@sferacarta.com обсуждение исходный текст |
Список | pgsql-hackers |
<tt>DECIMA/NUMERCI Report bug:</tt><tt></tt><p><tt>CREATE TABLE Test (num DEC(7,2), flt8 FLOAT(15));</tt><br /><tt>ERROR: Unable to locate type name 'dec' in catalog</tt><tt></tt><p><tt> The required syntax for DECIMAL is:</tt><br/><tt> DEC[IMAL] [ ( precision [ ,scale ] ) ]</tt><tt></tt><p><tt> from SQL/92 draft:</tt><br /><tt> <exact numeric type> ::=</tt><br /><tt> NUMERIC [ <left paren> <precision>[ <comma> <scale> ] <right pa</tt><br /><tt> | DECIMAL [ <left paren><precision> [ <comma> <scale> ] <right pa</tt><br /><tt> | DEC [ <left paren><precision> [ <comma> <scale> ] <right paren></tt><tt></tt><p><tt> Remarks: DECIMALcan be abbreviated as DEC.</tt><br /><tt></tt> <tt></tt><p><tt>CREATE TABLE Test (num DECimal(7,2), flt8 FLOAT(15));</tt><br/><tt>CREATE</tt><br /><tt>INSERT INTO Test VALUES (1,1);</tt><br /><tt>INSERT 207242 1</tt><br /><tt>INSERTINTO Test VALUES (2.343,2.343);</tt><br /><tt>INSERT 207243 1</tt><br /><tt>INSERT INTO Test VALUES (-3.0,-3.0);</tt><br/><tt>INSERT 207244 1</tt><br /><tt>select * from test;</tt><br /><tt> num| flt8</tt><br /><tt>-----+-----</tt><br/><tt> 1.00| 1</tt><br /><tt> 2.34|2.343</tt><br /><tt>-3.00| -3</tt><br /><tt>(3 rows)</tt><br/><tt></tt> <tt></tt><p><tt>--numeric and decimal doesn't support arithmetic operations with floats...</tt><tt></tt><p><tt>SELECTnum-flt8 FROM Test;</tt><br /><tt>ERROR: Unable to identify an operator '-' for types'numeric' and 'float8'</tt><br /><tt> You will have to retype this query using an explicit cast</tt><br /><tt>SELECTnum+flt8 FROM Test;</tt><br /><tt>ERROR: Unable to identify an operator '+' for types 'numeric' and 'float8'</tt><br/><tt> You will have to retype this query using an explicit cast</tt><br /><tt>SELECT num*flt8 FROMTest;</tt><br /><tt>ERROR: Unable to identify an operator '*' for types 'numeric' and 'float8'</tt><br /><tt> You will have to retype this query using an explicit cast</tt><br /><tt>SELECT num/flt8 FROM Test;</tt><br /><tt>ERROR: Unable to identify an operator '/' for types 'numeric' and 'float8'</tt><br /><tt> You will have to retypethis query using an explicit cast</tt><br /><tt>SELECT * FROM Test WHERE num < flt8;</tt><br /><tt>ERROR: Unableto identify an operator '<' for types 'numeric' and 'float8'</tt><br /><tt> You will have to retype thisquery using an explicit cast</tt><br /><tt></tt> <tt></tt><p><tt>--create operator doesn't know numeric/decimal type:</tt><tt></tt><p><tt>createoperator < (</tt><br /><tt> leftarg=numeric,</tt><br /><tt> rightarg=float8,</tt><br/><tt> procedure=dec_float8_lt</tt><br /><tt> );</tt><br /><tt>ERROR: parser: parseerror at or near "numeric"</tt><br /><tt>--</tt><br /><tt>___________________________________________________________________</tt><br/><tt>PostgreSQL 6.5.0 on i586-pc-linux-gnulibc1,compiled by gcc 2.7.2.1</tt><br /><tt>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</tt><br/><tt>Jose'</tt><br /><tt></tt>
В списке pgsql-hackers по дате отправления: