Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YYy5l-0007CA-Ue for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Mar 2015 14:40:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YYy5l-0000SA-Av for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Mar 2015 14:40:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YYvfn-0001sN-5i for pgsql-bugs@postgresql.org; Fri, 20 Mar 2015 12:05:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YYvfj-0006W4-Td for pgsql-bugs@postgresql.org; Fri, 20 Mar 2015 12:05:06 +0000 MIME-Version: 1.0 Subject: BUG #12883: Configurable identifier length truncation. To: pgsql-bugs@postgresql.org From: mariusz.kacala@wp.pl Date: Fri, 20 Mar 2015 12:04:50 +0000 Message-ID: <20150320120450.2562.1359@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 12883 Logged by: Mariusz KacaƂa Email address: mariusz.kacala@wp.pl PostgreSQL version: 9.3.4 Operating system: Windows, Linux Description: DOC says: 4.1.1. "(...) The system uses no more than NAMEDATALEN-1 bytes of an identifier; longer names can be written in commands, but they will be truncated. By default, NAMEDATALEN is 64 so the maximum identifier length is 63 bytes. (...)" I have a suggestion (rather than bug): I found default identifier truncation as quite problematic for application consistency. If you execute SQL query with identifier longer than 63 chars, postresql's console shows warning that identifier was truncated. It would be really useful and just nice to make it configurable. We would define in DB configuration (next to NAMEDATALEN 64) if identifier should be truncated or if query execution should fail. I don't see any problems with throwing exceptions because of too long identifier length instead of "silent" truncation this identifier to shorter at DB level. Could it be done? Could it cause any troubles? Query example: ALTER TABLE public.table_name ADD CONSTRAINT "very_long_unique_constraint_contains_more_than_default_namedatalen_length" UNIQUE (column_name) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs