Skip to content

Commit 66d17c3

Browse files
author
Thomas G. Lockhart
committed
Make TABLE an optional keyword, a la LOCK TABLE (gram.y fixes not yet
committed, but will be within a week or two). Actually include the reference page into the docs...
1 parent 03e5edb commit 66d17c3

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

doc/src/sgml/ref/allfiles.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/allfiles.sgml,v 1.11 1999/08/06 13:50:29 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/allfiles.sgml,v 1.12 1999/10/01 15:24:09 thomas Exp $
33
Postgres documentation
44
Complete list of usable sgml source files in this directory.
55
-->
@@ -93,6 +93,7 @@ Complete list of usable sgml source files in this directory.
9393
<!entity selectInto system "select_into.sgml">
9494
<!entity set system "set.sgml">
9595
<!entity show system "show.sgml">
96+
<!entity truncate system "truncate.sgml">
9697
<!entity unlisten system "unlisten.sgml">
9798
<!entity update system "update.sgml">
9899
<!entity vacuum system "vacuum.sgml">

doc/src/sgml/ref/commands.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/commands.sgml,v 1.18 1999/08/06 13:50:30 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/commands.sgml,v 1.19 1999/10/01 15:24:09 thomas Exp $
33
Postgres documentation
44
-->
55

@@ -67,6 +67,7 @@ Postgres documentation
6767
&selectInto;
6868
&set;
6969
&show;
70+
&truncate;
7071
&unlisten;
7172
&update;
7273
&vacuum;

doc/src/sgml/ref/truncate.sgml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/truncate.sgml,v 1.1 1999/09/23 17:02:28 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/truncate.sgml,v 1.2 1999/10/01 15:24:09 thomas Exp $
33
Postgres documentation
44
-->
55

@@ -15,15 +15,15 @@ Postgres documentation
1515
TRUNCATE
1616
</refname>
1717
<refpurpose>
18-
Close a cursor
18+
Empty a table
1919
</refpurpose>
2020
</refnamediv>
2121
<refsynopsisdiv>
2222
<refsynopsisdivinfo>
2323
<date>1999-07-20</date>
2424
</refsynopsisdivinfo>
2525
<synopsis>
26-
TRUNCATE TABLE <replaceable class="PARAMETER">table</replaceable>
26+
TRUNCATE [ TABLE ] <replaceable class="PARAMETER">name</replaceable>
2727
</synopsis>
2828

2929
<refsect2 id="R2-SQL-TRUNCATE-1">
@@ -37,10 +37,10 @@ TRUNCATE TABLE <replaceable class="PARAMETER">table</replaceable>
3737

3838
<variablelist>
3939
<varlistentry>
40-
<term><replaceable class="PARAMETER">table</replaceable></term>
40+
<term><replaceable class="PARAMETER">name</replaceable></term>
4141
<listitem>
4242
<para>
43-
The table name to truncate.
43+
The name of the table to be truncated.
4444
</para>
4545
</listitem>
4646
</varlistentry>
@@ -81,19 +81,24 @@ TRUNCATE
8181
Description
8282
</title>
8383
<para>
84-
<command>TRUNCATE</command> quickly removes all rows from a table.
84+
<command>TRUNCATE</command> quickly removes all rows from a
85+
table. It has the same effect as an unqualified
86+
<command>DELETE</command> but since it does not actually scan the
87+
table it is faster. This is most effective on large tables.
8588
</para>
86-
89+
</refsect1>
90+
8791
<refsect1 id="R1-SQL-TRUNCATE-2">
8892
<title>
8993
Usage
9094
</title>
9195
<para>
92-
Truncate the table bigtable.
93-
</para>
94-
<programlisting>
96+
Truncate the table <literal>bigtable</literal>:
97+
98+
<programlisting>
9599
TRUNCATE TABLE bigtable;
96-
</programlisting>
100+
</programlisting>
101+
</para>
97102
</refsect1>
98103

99104
<refsect1 id="R1-SQL-TRUNCATE-3">

0 commit comments

Comments
 (0)