Re: Prepared Statement Name Truncation

From: Craig Ringer <craig(at)2ndQuadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Phil Sorber <phil(at)omniti(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Prepared Statement Name Truncation
Date: 2012-11-20 01:23:54
Message-ID: 50AADBAA.2030104@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

On 11/19/2012 09:43 PM, Stephen Frost wrote:
> * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
>> Let me be clear here: I don't think we can or should ever make this
>> into an error by default. Doing that would break spec-compliant
>> applications, whether or not they are using names that actually have
>> any conflicts.
>
> If we increase the length to the spec requirement (full disclosure- I
> havn't checked the spec on this myself), I'd be for making it an error
> if someone goes over that limit. Right now we have a risk of spec
> compliant applications not working under PG for nearly zero good
> justification in today's age (iow- I don't really buy the concern about
> the size, and if that is a reasonable concern then we could look at
> putting in the effort to make it variable length and seriously reduce
> today's wasted space).
Wasted space is only part of the issue; it's also potentially
significantly cheaper to compare and copy fixed length names, especially
when you can copy on-stack arrays rather than palloc'ing memory.

I have not checked to see whether this is a concern in Pg's codebase;
I'm just aware it's been a reason for the use of fixed length strings in
software in general.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Hari Babu 2012-11-20 04:31:59 Re: BUG #7643: Issuing a shutdown request while server startup leads to server hang
Previous Message Yunong Xiao 2012-11-19 23:20:35 postgresql 9.2.1 dumps core on SmartOS(solaris) when the OS is rebooted

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2012-11-20 01:30:23 Re: Maintaining state across function calls
Previous Message Vlad Marchenko 2012-11-20 01:23:24 Re: High SYS CPU - need advise