Skip to content

Commit 9fcc115

Browse files
committed
Appears I forgot to update the docs earlier.
Please note I have no way to test this. Docbook doesn't like my cygwin setup. -- Rod Taylor
1 parent 80e232f commit 9fcc115

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

doc/src/sgml/ref/insert.sgml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/insert.sgml,v 1.17 2002/04/23 02:07:16 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/insert.sgml,v 1.18 2002/04/24 02:31:30 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -22,9 +22,9 @@ PostgreSQL documentation
2222
</refsynopsisdivinfo>
2323
<synopsis>
2424
INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable class="PARAMETER">column</replaceable> [, ...] ) ]
25-
{ DEFAULT VALUES | VALUES ( <replaceable class="PARAMETER">expression</replaceable> [, ...] ) | SELECT <replaceable class="PARAMETER">query</replaceable> }
25+
{ DEFAULT VALUES | VALUES ( { <replaceable class="PARAMETER">expression</replaceable> | DEFAULT } [, ...] ) | SELECT <replaceable class="PARAMETER">query</replaceable> }
2626
</synopsis>
27-
27+
2828
<refsect2 id="R2-SQL-INSERT-1">
2929
<title>
3030
Inputs
@@ -71,6 +71,16 @@ INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable
7171
</listitem>
7272
</varlistentry>
7373

74+
<varlistentry>
75+
<term><replaceable class="PARAMETER">DEFAULT</replaceable></term>
76+
<listitem>
77+
<para>
78+
This column will be filled in by the column DEFAULT clause, or NULL if
79+
a default is not available.
80+
</para>
81+
</listitem>
82+
</varlistentry>
83+
7484
<varlistentry>
7585
<term><replaceable class="PARAMETER">query</replaceable></term>
7686
<listitem>
@@ -83,7 +93,7 @@ INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable
8393
</variablelist>
8494
</para>
8595
</refsect2>
86-
96+
8797
<refsect2 id="R2-SQL-INSERT-2">
8898
<title>
8999
Outputs
@@ -133,7 +143,7 @@ INSERT 0 <replaceable>#</replaceable>
133143
</para>
134144

135145
<para>
136-
Each column not present in the target list will be inserted
146+
Each column not present in the target list will be inserted
137147
using a default value, either a declared DEFAULT value
138148
or NULL. <productname>PostgreSQL</productname> will reject the new
139149
column if a NULL is inserted into a column declared NOT NULL.
@@ -175,6 +185,18 @@ INSERT INTO films (code, title, did, date_prod, kind)
175185
</programlisting>
176186
</para>
177187

188+
<para>
189+
In the third example, we use the DEFAULT values for the date columns
190+
rather than specifying an entry.
191+
192+
<programlisting>
193+
INSERT INTO films VALUES
194+
('UA502','Bananas',105,DEFAULT,'Comedy',INTERVAL '82 minute');
195+
INSERT INTO films (code, title, did, date_prod, kind)
196+
VALUES ('T_601', 'Yojimbo', 106, DEFAULT, 'Drama');
197+
</programlisting>
198+
</para>
199+
178200
<para>
179201
Insert a single row into table distributors; note that
180202
only column <literal>name</literal> is specified, so the omitted
@@ -197,7 +219,7 @@ INSERT INTO films SELECT * FROM tmp;
197219
Insert into arrays (refer to the
198220
<citetitle>PostgreSQL User's Guide</citetitle> for further
199221
information about arrays):
200-
222+
201223
<programlisting>
202224
-- Create an empty 3x3 gameboard for noughts-and-crosses
203225
-- (all of these queries create the same board attribute)
@@ -215,14 +237,14 @@ INSERT INTO tictactoe (game, board)
215237
<title>
216238
Compatibility
217239
</title>
218-
240+
219241
<refsect2 id="R2-SQL-INSERT-4">
220242
<title>
221243
SQL92
222244
</title>
223245
<para>
224246
<command>INSERT</command> is fully compatible with <acronym>SQL92</acronym>.
225-
Possible limitations in features of the
247+
Possible limitations in features of the
226248
<replaceable class="PARAMETER">query</replaceable>
227249
clause are documented for
228250
<xref linkend="sql-select" endterm="sql-select-title">.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy