|
1 | 1 | <!-- |
2 | | -$PostgreSQL: pgsql/doc/src/sgml/typeconv.sgml,v 1.39 2003/11/29 19:51:38 pgsql Exp $ |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/typeconv.sgml,v 1.40 2003/12/01 21:53:15 momjian Exp $ |
3 | 3 | --> |
4 | 4 |
|
5 | 5 | <chapter Id="typeconv"> |
@@ -437,30 +437,6 @@ SELECT @ '-4.5e500' AS "abs"; |
437 | 437 | ERROR: "-4.5e500" is out of range for type double precision |
438 | 438 | </screen> |
439 | 439 | </para> |
440 | | - |
441 | | -<para> |
442 | | -On the other hand, the postfix operator <literal>!</> (factorial) |
443 | | -is defined only for integer data types, not for <type>float8</type>. So, if we |
444 | | -try a similar case with <literal>!</>, we get: |
445 | | -<screen> |
446 | | -SELECT '20' ! AS "factorial"; |
447 | | - |
448 | | -ERROR: operator is not unique: "unknown" ! |
449 | | -HINT: Could not choose a best candidate operator. You may need to add explicit |
450 | | -type casts. |
451 | | -</screen> |
452 | | -This happens because the system can't decide which of the several |
453 | | -possible <literal>!</> operators should be preferred. We can help |
454 | | -it out with an explicit cast: |
455 | | -<screen> |
456 | | -SELECT CAST('20' AS int8) ! AS "factorial"; |
457 | | - |
458 | | - factorial |
459 | | ---------------------- |
460 | | - 2432902008176640000 |
461 | | -(1 row) |
462 | | -</screen> |
463 | | -</para> |
464 | 440 | </example> |
465 | 441 |
|
466 | 442 | </sect1> |
|