Search Postgresql Archives

Re: Question about the NAME type used in pg_proc and pg_class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Fuhr <mike@xxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux