mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +03:00
Remove add_missing_from GUC and associated parser support for "implicit RTEs".
Per recent discussion, add_missing_from has been deprecated for long enough to consider removing, and it's getting in the way of planned parser refactoring. The system now always behaves as though add_missing_from were OFF.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/queries.sgml,v 1.55 2009/06/17 21:58:49 tgl Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/queries.sgml,v 1.56 2009/10/21 20:22:38 tgl Exp $ -->
|
||||
|
||||
<chapter id="queries">
|
||||
<title>Queries</title>
|
||||
@@ -521,23 +521,13 @@ SELECT * FROM some_very_long_table_name s JOIN another_fairly_long_name a ON s.i
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The alias becomes the new name of the table reference for the
|
||||
current query — it is no longer possible to refer to the table
|
||||
by the original name. Thus:
|
||||
The alias becomes the new name of the table reference so far as the
|
||||
current query is concerned — it is not allowed to refer to the
|
||||
table by the original name elsewhere in the query. Thus, this is not
|
||||
valid:
|
||||
<programlisting>
|
||||
SELECT * FROM my_table AS m WHERE my_table.a > 5;
|
||||
SELECT * FROM my_table AS m WHERE my_table.a > 5; -- wrong
|
||||
</programlisting>
|
||||
is not valid according to the SQL standard. In
|
||||
<productname>PostgreSQL</productname> this will draw an error, assuming the
|
||||
<xref linkend="guc-add-missing-from"> configuration variable is
|
||||
<literal>off</> (as it is by default). If it is <literal>on</>,
|
||||
an implicit table reference will be added to the
|
||||
<literal>FROM</literal> clause, so the query is processed as if
|
||||
it were written as:
|
||||
<programlisting>
|
||||
SELECT * FROM my_table AS m, my_table AS my_table WHERE my_table.a > 5;
|
||||
</programlisting>
|
||||
That will result in a cross join, which is usually not what you want.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
Reference in New Issue
Block a user