The following bug has been logged on the website:
Bug reference: 13659
Logged by: James Coleman
Email address: jtc331@gmail.com
PostgreSQL version: 9.4.4
Operating system: OS X (and Linux etc.)
Description:
If I create the following schema:
create table t(n integer);
alter table t add constraint
test_contrainst_that_has_a_very_long_name_to_trigger_the_character_limit
check (n != 1);
the constraint name appears to be automatically truncated without error, as
confirmed with:
SELECT tc.constraint_name, tc.table_name
FROM information_schema.table_constraints AS tc
WHERE tc.table_name = 't'
Since PG raises errors when index names, for example, are too long, I
believe it should do the same for constraints. I discussed this with Magnus
at PostgresOpen and he agreed that the behavior should be the same and that
if it weren't it was likely a bug.