Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZuuJ-0001ef-1A for pgsql-bugs@postgresql.org; Sun, 18 Nov 2012 02:46:51 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZuuG-0001o6-AE for pgsql-bugs@postgresql.org; Sun, 18 Nov 2012 02:46:50 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 62D162301B; Sat, 17 Nov 2012 21:46:46 -0500 (EST) Date: Sat, 17 Nov 2012 21:46:46 -0500 From: Stephen Frost To: Phil Sorber Cc: pgsql-bugs@postgresql.org Subject: Re: Prepared Statement Name Truncation Message-ID: <20121118024646.GH5162@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aGFtiWEqEIMVlCXZ" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.2.0-4-amd64 (x86_64) X-Uptime: 21:40:11 up 24 days, 1:04, 7 users, load average: 0.24, 0.20, 0.15 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.0 (--) X-Archive-Number: 201211/102 X-Sequence-Number: 34660 --aGFtiWEqEIMVlCXZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * 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 --aGFtiWEqEIMVlCXZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlCoTBYACgkQrzgMPqB3kijNPgCfcnlCKoFZXFxCuVt0bTGH9fd/ tQ8AnjUA/x6LhRFLU+9muDdpdQWYQNRl =IRkq -----END PGP SIGNATURE----- --aGFtiWEqEIMVlCXZ--