postgresql/src/include/parser
Tom Lane 06a7c3154f Allow most keywords to be used as column labels without requiring AS.
Up to now, if you tried to omit "AS" before a column label in a SELECT
list, it would only work if the column label was an IDENT, that is not
any known keyword.  This is rather unfriendly considering that we have
so many keywords and are constantly growing more.  In the wake of commit
1ed6b8956 it's possible to improve matters quite a bit.

We'd originally tried to make this work by having some of the existing
keyword categories be allowed without AS, but that didn't work too well,
because each category contains a few special cases that don't work
without AS.  Instead, invent an entirely orthogonal keyword property
"can be bare column label", and mark all keywords that way for which
we don't get shift/reduce errors by doing so.

It turns out that of our 450 current keywords, all but 39 can be made
bare column labels, improving the situation by over 90%.  This number
might move around a little depending on future grammar work, but it's
a pretty nice improvement.

Mark Dilger, based on work by myself and Robert Haas;
review by John Naylor

Discussion: https://postgr.es/m/38ca86db-42ab-9b48-2902-337a0d6b8311@2ndquadrant.com
2020-09-18 16:46:36 -04:00
..
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
analyze.h Fill in extraUpdatedCols in logical replication 2020-02-17 15:20:57 +01:00
gramparse.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
kwlist.h Allow most keywords to be used as column labels without requiring AS. 2020-09-18 16:46:36 -04:00
parse_agg.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parse_clause.h Support FETCH FIRST WITH TIES 2020-04-07 16:22:13 -04:00
parse_coerce.h Go back to returning int from ereport auxiliary functions. 2020-03-25 11:57:36 -04:00
parse_collate.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parse_cte.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parse_enr.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parse_expr.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parse_func.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parse_node.h Go back to returning int from ereport auxiliary functions. 2020-03-25 11:57:36 -04:00
parse_oper.h Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
parse_param.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parse_relation.h Reconsider the representation of join alias Vars. 2020-01-09 11:56:59 -05:00
parse_target.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parse_type.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parse_utilcmd.h Fix handling of CREATE TABLE LIKE with inheritance. 2020-08-21 15:00:47 -04:00
parser.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parsetree.h Make parser rely more heavily on the ParseNamespaceItem data structure. 2020-01-02 11:29:01 -05:00
scanner.h Go back to returning int from ereport auxiliary functions. 2020-03-25 11:57:36 -04:00
scansup.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00