Index: insert.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/insert.sgml,v retrieving revision 1.16 diff -c -r1.16 insert.sgml *** insert.sgml 2001/12/08 03:24:37 1.16 --- insert.sgml 2002/04/15 14:54:16 *************** *** 22,30 **** INSERT INTO table [ ( column [, ...] ) ] ! { DEFAULT VALUES | VALUES ( expression [, ...] ) | SELECT query } ! Inputs --- 22,30 ---- </refsynopsisdivinfo> <synopsis> INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable class="PARAMETER">column</replaceable> [, ...] ) ] ! { DEFAULT VALUES | VALUES ( { <replaceable class="PARAMETER">expression</replaceable> | DEFAULT } [, ...] ) | SELECT <replaceable class="PARAMETER">query</replaceable> } </synopsis> ! <refsect2 id="R2-SQL-INSERT-1"> <title> Inputs *************** *** 72,77 **** --- 72,87 ---- </varlistentry> <varlistentry> + <term><replaceable class="PARAMETER">DEFAULT</replaceable></term> + <listitem> + <para> + This column will be filled in by the column DEFAULT clause, or NULL if + a default is not available. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><replaceable class="PARAMETER">query</replaceable></term> <listitem> <para> *************** *** 83,89 **** </variablelist> </para> </refsect2> ! <refsect2 id="R2-SQL-INSERT-2"> <title> Outputs --- 93,99 ---- </variablelist> </para> </refsect2> ! <refsect2 id="R2-SQL-INSERT-2"> <title> Outputs *************** *** 133,139 **** </para> <para> ! Each column not present in the target list will be inserted using a default value, either a declared DEFAULT value or NULL. <productname>PostgreSQL</productname> will reject the new column if a NULL is inserted into a column declared NOT NULL. --- 143,149 ---- </para> <para> ! Each column not present in the target list will be inserted using a default value, either a declared DEFAULT value or NULL. <productname>PostgreSQL</productname> will reject the new column if a NULL is inserted into a column declared NOT NULL. *************** *** 176,181 **** --- 186,203 ---- </para> <para> + In the third example, we use the DEFAULT values for the date columns + rather than specifying an entry. + + <programlisting> + INSERT INTO films VALUES + ('UA502','Bananas',105,DEFAULT,'Comedy',INTERVAL '82 minute'); + INSERT INTO films (code, title, did, date_prod, kind) + VALUES ('T_601', 'Yojimbo', 106, DEFAULT, 'Drama'); + </programlisting> + </para> + + <para> Insert a single row into table distributors; note that only column <literal>name</literal> is specified, so the omitted column <literal>did</literal> will be assigned its default value: *************** *** 197,203 **** Insert into arrays (refer to the <citetitle>PostgreSQL User's Guide</citetitle> for further information about arrays): ! <programlisting> -- Create an empty 3x3 gameboard for noughts-and-crosses -- (all of these queries create the same board attribute) --- 219,225 ---- Insert into arrays (refer to the <citetitle>PostgreSQL User's Guide</citetitle> for further information about arrays): ! <programlisting> -- Create an empty 3x3 gameboard for noughts-and-crosses -- (all of these queries create the same board attribute) *************** *** 215,228 **** <title> Compatibility ! SQL92 INSERT is fully compatible with SQL92. ! Possible limitations in features of the query clause are documented for . --- 237,250 ---- Compatibility ! SQL92 INSERT is fully compatible with SQL92. ! Possible limitations in features of the query clause are documented for .