Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joshua Yanovski <pythonesque(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers
Date: 2014-02-13 18:57:53
Message-ID: 14955.1392317873@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Joshua Yanovski <pythonesque(at)gmail(dot)com> writes:
> There is one other thing I noticed in that area of the code--namely, if
> NAMEDATALEN is low enough, an identifier can be truncated down to an empty
> identifier, since the check for empty identifier length is done before the
> call to truncate_identifier. But I doubt this will ever be a problem in
> practice and there may be other compensatory checks elsewhere.

That'd only be possible if NAMEDATALEN were smaller than the longest
possible multibyte character, which I think is not a case we need to
concern ourselves with. We currently don't support multibytes longer
than 4 bytes, and even if we do full Unicode somewhere down the line,
it'd still only be 6 bytes. I can't imagine anyone wanting to run
with NAMEDATALEN less than 16 or so --- even if they tried, it'd likely
not work because of conflicts in the names of built-in functions.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Joshua Yanovski 2014-02-13 19:17:44 Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers
Previous Message Joshua Yanovski 2014-02-13 18:15:12 Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers