Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TacZH-0001Rn-VP for pgsql-bugs@postgresql.org; Tue, 20 Nov 2012 01:24:04 +0000 Received: from outmail148161.authsmtp.com ([62.13.148.161]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TacZG-0002fe-Hy for pgsql-bugs@postgresql.org; Tue, 20 Nov 2012 01:24:03 +0000 Received: from mail-c209.authsmtp.com (mail-c209.authsmtp.com [62.13.128.209]) by punt6.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id qAK1O07X090535; Tue, 20 Nov 2012 01:24:00 GMT Received: from ayaki.localdomain (124-148-90-153.dyn.iinet.net.au [124.148.90.153]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id qAK1NsPx043550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Nov 2012 01:23:57 GMT Message-ID: <50AADBAA.2030104@2ndQuadrant.com> Date: Tue, 20 Nov 2012 09:23:54 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121029 Thunderbird/16.0.2 MIME-Version: 1.0 To: Stephen Frost CC: Tom Lane , Phil Sorber , pgsql-bugs@postgresql.org Subject: Re: Prepared Statement Name Truncation References: <23706.1353223982@sss.pgh.pa.us> <18330.1353283998@sss.pgh.pa.us> <20121119134345.GK5162@tamriel.snowman.net> In-Reply-To: <20121119134345.GK5162@tamriel.snowman.net> X-Enigmail-Version: 1.4.5 Content-Type: multipart/alternative; boundary="------------040104000803050206010006" X-Server-Quench: f5e2b67d-32b0-11e2-9bd2-001f29070be2 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZeVg0b BQteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksachtFagVbY1ZH HGQLWlZEUFx7W2B/ bgMfbAdZfEtKVxtj UFZIR1FNFgBqBAMA SF9vKRgMNGUOeHpz YENiEHJYXkx6OxB4 F0wGE2pSeGRiOmAC UUENdR5dIldIYx9F awZ9XXMKYTdSZDQC El17DBoMEg5qYBxP TxkEN18eCX0XFyIx Qh0EAX0JFEgIDxkp MhotI0IdG0B5 X-Authentic-SMTP: 61633235383639.1012:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 124.148.90.153/2525 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201211/149 X-Sequence-Number: 34707 This is a multi-part message in MIME format. --------------040104000803050206010006 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 11/19/2012 09:43 PM, Stephen Frost wrote: > * Tom Lane (tgl@sss.pgh.pa.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 --------------040104000803050206010006 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 11/19/2012 09:43 PM, Stephen Frost wrote:
> * Tom Lane (tgl@sss.pgh.pa.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

--------------040104000803050206010006--