Michael Fuhr <mike@fuhr.org> writes:
> See "Identifiers and Key Words" in the "SQL Syntax" chapter:
> "The system uses no more than NAMEDATALEN-1 characters of an identifier;
> longer names can be written in commands, but they will be truncated. By
> default, NAMEDATALEN is 64 so the maximum identifier length is 63."
This limit also applies to operator names, and I just noticed that
scan.l isn't enforcing the limit for operators. In a build with asserts
enabled this leads to an assertion failure :-(
regression=# select 1 *********************************************************************************** 2;
server closed the connection unexpectedly
with this in the log:
TRAP: FailedAssertion("!(keylen < 64)", File: "hashfunc.c", Line: 129)
I believe that there would be no real ill effect in a non-assertion
build, it would just say it couldn't find the operator. Too lazy to
recompile that way to find out though.
I kinda think that truncation isn't a real sensible way to deal with
overly long operator names anyway, and that throwing an ERROR would be
more reasonable; if the scanner thinks it is looking at an 80-character
operator name, you've probably messed up the syntax somewhere along the
line. Comments?
regards, tom lane