postgresql/src/backend/commands
Tom Lane fb8697b31a Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers.
We have a lot of code in which option names, which from the user's
viewpoint are logically keywords, are passed through the grammar as plain
identifiers, and then matched to string literals during command execution.
This approach avoids making words into lexer keywords unnecessarily.  Some
places matched these strings using plain strcmp, some using pg_strcasecmp.
But the latter should be unnecessary since identifiers would have been
downcased on their way through the parser.  Aside from any efficiency
concerns (probably not a big factor), the lack of consistency in this area
creates a hazard of subtle bugs due to different places coming to different
conclusions about whether two option names are the same or different.
Hence, standardize on using strcmp() to match any option names that are
expected to have been fed through the parser.

This does create a user-visible behavioral change, which is that while
formerly all of these would work:
	alter table foo set (fillfactor = 50);
	alter table foo set (FillFactor = 50);
	alter table foo set ("fillfactor" = 50);
	alter table foo set ("FillFactor" = 50);
now the last case will fail because that double-quoted identifier is
different from the others.  However, none of our documentation says that
you can use a quoted identifier in such contexts at all, and we should
discourage doing so since it would break if we ever decide to parse such
constructs as true lexer keywords rather than poor man's substitutes.
So this shouldn't create a significant compatibility issue for users.

Daniel Gustafsson, reviewed by Michael Paquier, small changes by me

Discussion: https://postgr.es/m/29405B24-564E-476B-98C0-677A29805B84@yesql.se
2018-01-26 18:25:14 -05:00
..
aggregatecmds.c Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
alter.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
amcmds.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
analyze.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
async.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
cluster.c Ignore partitioned indexes where appropriate 2018-01-25 16:12:15 -03:00
collationcmds.c Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
comment.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
constraint.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
conversioncmds.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
copy.c Allow UPDATE to move rows between partitions. 2018-01-19 15:33:06 -05:00
createas.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
dbcommands.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
define.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
discard.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
dropcmds.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
event_trigger.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
explain.c Add QueryEnvironment to ExplainOneQuery_hook's parameter list. 2018-01-11 12:16:18 -05:00
extension.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
foreigncmds.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
functioncmds.c Remove the obsolete WITH clause of CREATE FUNCTION. 2018-01-26 12:25:44 -05:00
indexcmds.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
lockcmds.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
Makefile Implement multivariate n-distinct coefficients 2017-03-24 14:06:10 -03:00
matview.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
opclasscmds.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
operatorcmds.c Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
policy.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
portalcmds.c Remove PortalGetQueryDesc() 2018-01-09 13:47:56 -05:00
prepare.c Update portal-related memory context names and API 2018-01-09 13:47:56 -05:00
proclang.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
publicationcmds.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
schemacmds.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
seclabel.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
sequence.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
statscmds.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
subscriptioncmds.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
tablecmds.c Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
tablespace.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
trigger.c Allow UPDATE to move rows between partitions. 2018-01-19 15:33:06 -05:00
tsearchcmds.c Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
typecmds.c Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
user.c Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
vacuum.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
vacuumlazy.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
variable.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
view.c Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00