aboutsummaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref/delete.sgml
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2006-01-22 05:20:35 +0000
committerNeil Conway <neilc@samurai.com>2006-01-22 05:20:35 +0000
commit1d763d9107eda2db054d0f7edee4c2e9b55dfacf (patch)
tree8493a62bce7056bad829013e2d7abbb89bfa0f2c /doc/src/sgml/ref/delete.sgml
parent57a84ca48e8901e77583f0c415f288430f5d66af (diff)
downloadpostgresql-1d763d9107eda2db054d0f7edee4c2e9b55dfacf.tar.gz
postgresql-1d763d9107eda2db054d0f7edee4c2e9b55dfacf.zip
Allow an optional alias for the target table to be specified for UPDATE
and DELETE. If specified, the alias must be used instead of the full table name. Also, the alias currently cannot be used in the SET clause of UPDATE. Patch from Atsushi Ogawa, various editorialization by Neil Conway. Along the way, make the rowtypes regression test pass if add_missing_from is enabled, and add a new (skeletal) regression test for DELETE.
Diffstat (limited to 'doc/src/sgml/ref/delete.sgml')
-rw-r--r--doc/src/sgml/ref/delete.sgml17
1 files changed, 15 insertions, 2 deletions
diff --git a/doc/src/sgml/ref/delete.sgml b/doc/src/sgml/ref/delete.sgml
index 8369d991372..b61e6cacd21 100644
--- a/doc/src/sgml/ref/delete.sgml
+++ b/doc/src/sgml/ref/delete.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/delete.sgml,v 1.25 2005/11/01 21:09:50 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/delete.sgml,v 1.26 2006/01/22 05:20:33 neilc Exp $
PostgreSQL documentation
-->
@@ -20,7 +20,7 @@ PostgreSQL documentation
<refsynopsisdiv>
<synopsis>
-DELETE FROM [ ONLY ] <replaceable class="PARAMETER">table</replaceable>
+DELETE FROM [ ONLY ] <replaceable class="PARAMETER">table</replaceable> [ [ AS ] <replaceable class="parameter">alias</replaceable> ]
[ USING <replaceable class="PARAMETER">usinglist</replaceable> ]
[ WHERE <replaceable class="PARAMETER">condition</replaceable> ]
</synopsis>
@@ -92,6 +92,19 @@ DELETE FROM [ ONLY ] <replaceable class="PARAMETER">table</replaceable>
</varlistentry>
<varlistentry>
+ <term><replaceable class="parameter">alias</replaceable></term>
+ <listitem>
+ <para>
+ A substitute name for the target table. When an alias is
+ provided, it completely hides the actual name of the table. For
+ example, given <literal>DELETE FROM foo AS f</>, the remainder
+ of the <command>DELETE</command> statement must refer to this
+ table as <literal>f</> not <literal>foo</>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><replaceable class="PARAMETER">usinglist</replaceable></term>
<listitem>
<para>