BUG #12883: Configurable identifier length truncation. - Mailing list pgsql-bugs

From mariusz.kacala@wp.pl
Subject BUG #12883: Configurable identifier length truncation.
Date
Msg-id 20150320120450.2562.1359@wrigleys.postgresql.org
Whole thread Raw
List pgsql-bugs
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)

pgsql-bugs by date:

Previous
From: Asif Naeem
Date:
Subject: Re: pg_upgrade failure on Windows Server
Next
From: John R Pierce
Date:
Subject: Re: Problem when installing PL/Proxy with Windows OS