1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.47 2001/01/13 18:34:51 petere Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.48 2001/01/26 22:04:22 petere Exp $
3
3
-->
4
4
5
5
<chapter id="datatype">
@@ -335,8 +335,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.47 2001/01/13 18:34:51 pe
335
335
</para>
336
336
337
337
<para>
338
- The numeric types have a full set of corresponding arithmetic operators and
339
- functions. Refer to <xref linkend="functions"> for more information.
338
+ The syntax of constants for the numeric types is described in
339
+ <xref linkend="sql-syntax-constants">. The numeric types have a
340
+ full set of corresponding arithmetic operators and
341
+ functions. Refer to <xref linkend="functions"> for more
342
+ information.
340
343
</para>
341
344
342
345
<para>
@@ -362,7 +365,7 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
362
365
<programlisting>
363
366
CREATE SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceable class="parameter">colname</replaceable>_seq;
364
367
CREATE TABLE <replaceable class="parameter">tablename</replaceable>
365
- (<replaceable class="parameter">colname</replaceable> INT4 DEFAULT nextval('<replaceable class="parameter">tablename</replaceable>_<replaceable class="parameter">colname</replaceable>_seq');
368
+ (<replaceable class="parameter">colname</replaceable> integer DEFAULT nextval('<replaceable class="parameter">tablename</replaceable>_<replaceable class="parameter">colname</replaceable>_seq');
366
369
CREATE UNIQUE INDEX <replaceable class="parameter">tablename</replaceable>_<replaceable class="parameter">colname</replaceable>_key on <replaceable class="parameter">tablename</replaceable> (<replaceable class="parameter">colname</replaceable>);
367
370
</programlisting>
368
371
@@ -394,20 +397,29 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
394
397
<title>Monetary Type</title>
395
398
396
399
<note>
397
- <title>Obsolete Type </title>
400
+ <title>Deprecated </title>
398
401
<para>
399
- The <type>money</type> is now deprecated. Use <type>numeric</type>
400
- or <type>decimal</type> instead. The money type may become a
401
- locale-aware layer over the numeric type in a future release.
402
+ The <type>money</type> is now deprecated. Use
403
+ <type>numeric</type> or <type>decimal</type> instead, in
404
+ combination with the <function>to_char</function> function. The
405
+ money type may become a locale-aware layer over the
406
+ <type>numeric</type> type in a future release.
402
407
</para>
403
408
</note>
404
409
405
410
<para>
406
- The <type>money</type> type supports US-style currency with
407
- fixed decimal point representation.
408
- If <productname>Postgres</productname> is compiled with USE_LOCALE
409
- then the money type should use the monetary conventions defined for
410
- <citetitle>locale(7)</citetitle>.
411
+ The <type>money</type> type stores U.S.-style currency with fixed
412
+ decimal point representation. If
413
+ <productname>Postgres</productname> is compiled with locale
414
+ support then the <type>money</type> type uses locale-specific
415
+ output formatting.
416
+ </para>
417
+
418
+ <para>
419
+ Input is accepted in a variety of formats, including integer and
420
+ floating point literals, as well as <quote>typical</quote>
421
+ currency formatting, such as <literal>'$1,000.00'</literal>.
422
+ Output is in the latter form.
411
423
</para>
412
424
413
425
<para>
@@ -434,14 +446,9 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
434
446
</tgroup>
435
447
</table>
436
448
</para>
437
-
438
- <para>
439
- <type>numeric</type>
440
- will replace the money type, and should be preferred.
441
- </para>
442
-
443
449
</sect1>
444
450
451
+
445
452
<sect1 id="datatype-character">
446
453
<title>Character Types</title>
447
454
@@ -455,6 +462,12 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
455
462
limit on the size of the field.
456
463
</para>
457
464
465
+ <para>
466
+ Refer to <xref linkend="sql-syntax-strings"> for information about
467
+ the syntax of string literals, and to <xref linkend="functions">
468
+ for information about available operators and functions.
469
+ </para>
470
+
458
471
<para>
459
472
<table tocentry="1">
460
473
<title><productname>Postgres</productname> Character Types</title>
@@ -661,8 +674,14 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
661
674
</para>
662
675
663
676
<para>
664
- Remember that any date or time input needs to be enclosed into single quotes,
665
- like text strings.
677
+ Remember that any date or time input needs to be enclosed into
678
+ single quotes, like text strings. Refer to <xref
679
+ linkend="sql-syntax-constants-generic"> for more information.
680
+ SQL requires the following syntax
681
+ <synopsis>
682
+ <replaceable>type</replaceable> '<replaceable>value</replaceable>'
683
+ </synopsis>
684
+ but <productname>Postgres</productname> is more flexible.
666
685
</para>
667
686
668
687
<sect3>
@@ -1393,20 +1412,20 @@ January 8 04:05:06 1999 PST
1393
1412
<thead>
1394
1413
<row>
1395
1414
<entry>State</entry>
1396
- <entry>Output</entry>
1397
1415
<entry>Input</entry>
1416
+ <entry>Output</entry>
1398
1417
</row>
1399
1418
</thead>
1400
1419
<tbody>
1401
1420
<row>
1402
1421
<entry>True</entry>
1403
- <entry>'t'</entry>
1404
1422
<entry>TRUE, 't', 'true', 'y', 'yes', '1'</entry>
1423
+ <entry><literal>t</literal></entry>
1405
1424
</row>
1406
1425
<row>
1407
1426
<entry>False</entry>
1408
- <entry>'f'</entry>
1409
1427
<entry>FALSE, 'f', 'false', 'n', 'no', '0'</entry>
1428
+ <entry><literal>f</literal></entry>
1410
1429
</row>
1411
1430
</tbody>
1412
1431
</tgroup>
0 commit comments