Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit61737a7

Browse files
committed
Add some links from data type chapter to section on literal constants.
1 parent6434ce6 commit61737a7

File tree

2 files changed

+45
-26
lines changed

2 files changed

+45
-26
lines changed

‎doc/src/sgml/datatype.sgml

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
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 $
33
-->
44

55
<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
335335
</para>
336336

337337
<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.
340343
</para>
341344

342345
<para>
@@ -362,7 +365,7 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
362365
<programlisting>
363366
CREATE SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceable class="parameter">colname</replaceable>_seq;
364367
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');
366369
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>);
367370
</programlisting>
368371

@@ -394,20 +397,29 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
394397
<title>Monetary Type</title>
395398

396399
<note>
397-
<title>Obsolete Type</title>
400+
<title>Deprecated</title>
398401
<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.
402407
</para>
403408
</note>
404409

405410
<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.
411423
</para>
412424

413425
<para>
@@ -434,14 +446,9 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
434446
</tgroup>
435447
</table>
436448
</para>
437-
438-
<para>
439-
<type>numeric</type>
440-
will replace the money type, and should be preferred.
441-
</para>
442-
443449
</sect1>
444450

451+
445452
<sect1 id="datatype-character">
446453
<title>Character Types</title>
447454

@@ -455,6 +462,12 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
455462
limit on the size of the field.
456463
</para>
457464

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+
458471
<para>
459472
<table tocentry="1">
460473
<title><productname>Postgres</productname> Character Types</title>
@@ -661,8 +674,14 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
661674
</para>
662675

663676
<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.
666685
</para>
667686

668687
<sect3>
@@ -1393,20 +1412,20 @@ January 8 04:05:06 1999 PST
13931412
<thead>
13941413
<row>
13951414
<entry>State</entry>
1396-
<entry>Output</entry>
13971415
<entry>Input</entry>
1416+
<entry>Output</entry>
13981417
</row>
13991418
</thead>
14001419
<tbody>
14011420
<row>
14021421
<entry>True</entry>
1403-
<entry>'t'</entry>
14041422
<entry>TRUE, 't', 'true', 'y', 'yes', '1'</entry>
1423+
<entry><literal>t</literal></entry>
14051424
</row>
14061425
<row>
14071426
<entry>False</entry>
1408-
<entry>'f'</entry>
14091427
<entry>FALSE, 'f', 'false', 'n', 'no', '0'</entry>
1428+
<entry><literal>f</literal></entry>
14101429
</row>
14111430
</tbody>
14121431
</tgroup>

‎doc/src/sgml/syntax.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.37 2001/01/22 23:34:33 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.38 2001/01/26 22:04:22 petere Exp $
33
-->
44

55
<chapter id="sql-syntax">
@@ -304,7 +304,7 @@ REAL '1.23' -- string style
304304
</para>
305305
</sect3>
306306

307-
<sect3>
307+
<sect3 id="sql-syntax-constants-generic">
308308
<title>Constants of Other Types</title>
309309

310310
<para>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp