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

Commit33cd0e5

Browse files
committed
doc: adjust UPDATE/DELETE's FROM/USING to match SELECT's FROM
Previously the syntax and wording were unclear.Reported-by: Alexey BashtanovDiscussion:https://postgr.es/m/968d4724-8e58-788f-7c45-f7b1813824cc@imap.ccBackpatch-through: 9.5
1 parent0936d1b commit33cd0e5

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

‎doc/src/sgml/ref/delete.sgml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ PostgreSQL documentation
2323
<synopsis>
2424
[ WITH [ RECURSIVE ] <replaceable class="parameter">with_query</replaceable> [, ...] ]
2525
DELETE FROM [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [ [ AS ] <replaceable class="parameter">alias</replaceable> ]
26-
[ USING <replaceable class="parameter">using_list</replaceable> ]
26+
[ USING <replaceable class="parameter">from_item</replaceable> [, ...] ]
2727
[ WHERE <replaceable class="parameter">condition</replaceable> | WHERE CURRENT OF <replaceable class="parameter">cursor_name</replaceable> ]
2828
[ RETURNING * | <replaceable class="parameter">output_expression</replaceable> [ [ AS ] <replaceable class="parameter">output_name</replaceable> ] [, ...] ]
2929
</synopsis>
@@ -117,17 +117,17 @@ DELETE FROM [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ *
117117
</varlistentry>
118118

119119
<varlistentry>
120-
<term><replaceable class="parameter">using_list</replaceable></term>
120+
<term><replaceable class="parameter">from_item</replaceable></term>
121121
<listitem>
122122
<para>
123-
Alist oftableexpressions, allowing columns from other tables
124-
to appearin the <literal>WHERE</literal> condition. Thisis similar
125-
to the list of tables that can be specified inthe <xref
126-
linkend="sql-from" endterm="sql-from-title"/> of a
127-
<command>SELECT</command> statement; for example, an alias for
128-
thetablename can be specified. Do not repeat the target table
129-
inthe <replaceable class="parameter">using_list</replaceable>,
130-
unless you wish to set up a self-join.
123+
A tableexpression allowing columns from other tables to appear
124+
in the <literal>WHERE</literal> condition. Thisuses the same
125+
syntax asthe <xref linkend="sql-from" endterm="sql-from-title"/>
126+
of a <command>SELECT</command> statement; for example, an alias
127+
for the table name can be specified. Do not repeat the target
128+
tableas a <replaceable class="parameter">from_item</replaceable>
129+
unless you wish to set up a self-join (inwhich case it must appear
130+
with an alias in the <replaceable>from_item</replaceable>).
131131
</para>
132132
</listitem>
133133
</varlistentry>

‎doc/src/sgml/ref/update.sgml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ UPDATE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [
2727
( <replaceable class="parameter">column_name</replaceable> [, ...] ) = [ ROW ] ( { <replaceable class="parameter">expression</replaceable> | DEFAULT } [, ...] ) |
2828
( <replaceable class="parameter">column_name</replaceable> [, ...] ) = ( <replaceable class="parameter">sub-SELECT</replaceable> )
2929
} [, ...]
30-
[ FROM <replaceable class="parameter">from_list</replaceable> ]
30+
[ FROM <replaceable class="parameter">from_item</replaceable> [, ...] ]
3131
[ WHERE <replaceable class="parameter">condition</replaceable> | WHERE CURRENT OF <replaceable class="parameter">cursor_name</replaceable> ]
3232
[ RETURNING * | <replaceable class="parameter">output_expression</replaceable> [ [ AS ] <replaceable class="parameter">output_name</replaceable> ] [, ...] ]
3333
</synopsis>
@@ -167,17 +167,17 @@ UPDATE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [
167167
</varlistentry>
168168

169169
<varlistentry>
170-
<term><replaceable class="parameter">from_list</replaceable></term>
170+
<term><replaceable class="parameter">from_item</replaceable></term>
171171
<listitem>
172172
<para>
173-
Alist oftableexpressions, allowing columns from other tables
174-
to appear inthe <literal>WHERE</literal> condition andtheupdate
175-
expressions. This is similar to thelist of tables that can be
176-
specified in the <xref linkend="sql-from"
177-
endterm="sql-from-title"/> of a <command>SELECT</command>
178-
statement. Note thatthe target tablemust not appear in the
179-
<replaceable>from_list</replaceable>,unless you intend a self-join (in which
180-
case it must appear withan alias in the <replaceable>from_list</replaceable>).
173+
A tableexpression allowing columns from other tables to appear in
174+
the <literal>WHERE</literal> condition and update expressions. This
175+
uses the same syntax as the<xref linkend="sql-from"
176+
endterm="sql-from-title"/> of a <command>SELECT</command> statement;
177+
for example, an alias for the table name can be specified. Do not
178+
repeatthe target tableas a <replaceable>from_item</replaceable>
179+
unless you intend a self-join (in which case it must appear with
180+
an alias in the <replaceable>from_item</replaceable>).
181181
</para>
182182
</listitem>
183183
</varlistentry>
@@ -267,7 +267,7 @@ UPDATE <replaceable class="parameter">count</replaceable>
267267
<para>
268268
When a <literal>FROM</literal> clause is present, what essentially happens
269269
is that the target table is joined to the tables mentioned in the
270-
<replaceable>from_list</replaceable>, and each output row of the join
270+
<replaceable>from_item</replaceable> list, and each output row of the join
271271
represents an update operation for the target table. When using
272272
<literal>FROM</literal> you should ensure that the join
273273
produces at most one output row for each row to be modified. In

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp