diff options
author | Dean Rasheed <dean.a.rasheed@gmail.com> | 2022-07-20 09:29:42 +0100 |
---|---|---|
committer | Dean Rasheed <dean.a.rasheed@gmail.com> | 2022-07-20 09:29:42 +0100 |
commit | bcedd8f5fce0b69970cf0cee7bca560833d05869 (patch) | |
tree | c37888d24735977b7a0463b0277c1cbe459ac69f /src/include/parser/parse_node.h | |
parent | 1caf915ff31e91031f0a0b8e1016df2b59d6f9de (diff) | |
download | postgresql-bcedd8f5fce0b69970cf0cee7bca560833d05869.tar.gz postgresql-bcedd8f5fce0b69970cf0cee7bca560833d05869.zip |
Make subquery aliases optional in the FROM clause.
This allows aliases for sub-SELECTs and VALUES clauses in the FROM
clause to be omitted.
This is an extension of the SQL standard, supported by some other
database systems, and so eases the transition from such systems, as
well as removing the minor inconvenience caused by requiring these
aliases.
Patch by me, reviewed by Tom Lane.
Discussion: https://postgr.es/m/CAEZATCUCGCf82=hxd9N5n6xGHPyYpQnxW8HneeH+uP7yNALkWA@mail.gmail.com
Diffstat (limited to 'src/include/parser/parse_node.h')
-rw-r--r-- | src/include/parser/parse_node.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h index cf9c7590258..962ebf65de1 100644 --- a/src/include/parser/parse_node.h +++ b/src/include/parser/parse_node.h @@ -246,8 +246,11 @@ struct ParseState * visible for qualified references) but it does hide their columns * (unqualified references to the columns refer to the JOIN, not the member * tables, so we must not complain that such a reference is ambiguous). - * Various special RTEs such as NEW/OLD for rules may also appear with only - * one flag set. + * Conversely, a subquery without an alias does not hide the columns selected + * by the subquery, but it does hide the auto-generated relation name (so the + * subquery columns are visible for unqualified references only). Various + * special RTEs such as NEW/OLD for rules may also appear with only one flag + * set. * * While processing the FROM clause, namespace items may appear with * p_lateral_only set, meaning they are visible only to LATERAL |