Re: Prepared Statement Name Truncation

From: Phil Sorber <phil(at)omniti(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Prepared Statement Name Truncation
Date: 2012-11-18 18:14:26
Message-ID: CADAkt-h6WGZxunpXz2H+LoXHKDtR=0yKcWcDO=MKYRJApxEw8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

On Sun, Nov 18, 2012 at 2:33 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Phil Sorber <phil(at)omniti(dot)com> writes:
>> An install of ours was having an issue with log files filling up the
>> disk rather quickly. After looking into it, the log was filling up
>> with NOTICE's caused by an ORM that was using a very long identifier
>> as a name for a prepared statement. It was a concatenation of tables
>> in the query.
>
> Just to be clear here ... does this ORM expect that it can concatenate
> *any* two legal identifiers into another one? If so, it's going to be
> broken no matter what the specific length limit is.
>
> regards, tom lane

I'm not sure if this particular ORM would expect that, but for the
sake of this discussion I think we should assume that whatever ORM
might be interfacing with postgres is doing "the right thing" as it
relates to the spec and we should work to minimize bad interactions. I
assume that was the point of the truncation to begin with, but
unintended consequences and all...

I understand your concern about the cost/benefit of fixing the length
to match spec.

I think making this a warning now would be a bit more forceful way to
let people know that this is a bad idea and this is a case where maybe
they need to work around postgres' lack of conformance to the spec. It
would most likely be caught sooner as well by DBA's. Then in 9.3 we
can make it an error with a GUC to easily override it back to a
warning. So that if it does break people's applications, they can
catch it in testing before an upgrade (assuming they test) and there
is a simple work around so they don't have to change their application
before upgrade. Also with the benefit of being even more forceful in
saying "Don't do that like that!" With a mention in the release notes
of course.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-11-18 18:18:42 Re: BUG #7670: BUG #7545: Unresponsive server with error log reporting: "poll() failed: Invalid argument"
Previous Message Andres Freund 2012-11-18 18:06:54 Re: BUG #7670: BUG #7545: Unresponsive server with error log reporting: "poll() failed: Invalid argument"

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2012-11-18 22:24:36 Re: High SYS CPU - need advise
Previous Message Vick Khera 2012-11-18 16:57:52 Re: Difference between varchar and text?