Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZvyL-00058L-5P for pgsql-bugs@postgresql.org; Sun, 18 Nov 2012 03:55:05 +0000 Received: from mbx.knossos.net.nz ([202.160.48.10]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZvyF-0002jV-TO for pgsql-bugs@postgresql.org; Sun, 18 Nov 2012 03:55:04 +0000 Received: from [10.1.1.3] (60-234-150-59.bitstream.orcon.net.nz [60.234.150.59]) (authenticated bits=0) by mbx.knossos.net.nz (8.14.4/8.14.4) with ESMTP id qAI3sgBK025282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 18 Nov 2012 16:54:43 +1300 Message-ID: <50A85C02.5030309@archidevsys.co.nz> Date: Sun, 18 Nov 2012 16:54:42 +1300 From: Gavin Flower Organization: ArchiDevSys User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Stephen Frost CC: Phil Sorber , pgsql-bugs@postgresql.org Subject: Re: Prepared Statement Name Truncation References: <20121118024646.GH5162@tamriel.snowman.net> In-Reply-To: <20121118024646.GH5162@tamriel.snowman.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201211/104 X-Sequence-Number: 34662 On 18/11/12 15:46, Stephen Frost wrote: > * Phil Sorber (phil@omniti.com) wrote: >> In addition it actually works! > Only until the ORM tries to create two tables that are identical except > for the last few characters.. > >> So I am sharing this with the list to see what people think. Is this a >> configuration bug? An ORM bug? A postgres bug? An unfortunate >> interaction? > It's a bug that the ORM doesn't correctly handle this particular > per-system limitation cleanly. > >> If it's a postgres bug, what is the fix? Make the identifier max size >> longer? Set a hard limit and ERROR instead of truncating and NOTICE? >> Both? Neither because that would break backward compatibility? > Making the identifier longer wouldn't fix anything- an ORM might still > think it can make identifiers longer than whatever PG is configured to > support. Making it unlimited in length would be a huge amount of work > without much gain, imv. ERROR'ing instead of NOTICE'ing is certainly an > option, but it'd break any existing users of this busted ORM or other > similar setups. That's not to say we couldn't do it, but it'd have to > be clearly stated in the release notes and be done as part of the next > major version of PG. > > For my part, being very adverse to PG possibly giving the wrong result > (consider INSERT statements which work against a table that doesn't > exist- because the identifier is truncated and happens to end up > matching a table that does exist), I'd advocate changing this to be an > ERROR in 9.3. I don't see the value in the truncation and feel it's > actually dangerous, particularly if ORMs are doing things like this. > > Thanks, > > Stephen +1 I hate silent errors that could potential create major problems! It is far too MySQLish - prepares to duck and run before realizing this is not a MySQL list! :-) Maybe a configuration variable to allow unsafe truncation: for those people who either have no choice, and/or prefer expediency to safety! Cheers, Gavin