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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about the NAME type used in pg_proc and pg_class
Дата
Msg-id 9936.1124124805@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Question about the NAME type used in pg_proc and pg_class  (Michael Fuhr <mike@fuhr.org>)
Ответы Re: Question about the NAME type used in pg_proc and pg_class  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: error inserting big files in DB.
Следующее
От: Oluwatope Akinniyi
Дата:
Сообщение: Re: ~/pgpass