Truncation of identifiers - Mailing list pgsql-hackers

From Thomas Munro
Subject Truncation of identifiers
Date
Msg-id CAEepm=16Gcuu1WRk5-jqheMvNxOSZ_c98vMKC1qDwOiNBR-Z0Q@mail.gmail.com
Whole thread Raw
Responses Re: Truncation of identifiers
List pgsql-hackers
Hi hackers

Wouldn't it be better to raise an error when identifiers are too long,
rather than accepting but truncating them?  I'm not aware of any other
database that does this.  If you're using oversized identifiers you
could finish up using more than one way to refer to the same database
object, and then your queries will have a different meaning if
NAMEDATALEN ever changes.  If you're automatically generating
identifier names (say for partitioning), wouldn't you rather find out
about the size being too long immediately, rather than later when you
try to generate a second long name that collides with the first after
truncation?  I suppose there could be a GUC
truncate_oversized_identifiers defaulting to off, which could be
turned on by those who really prefer the current
truncate-but-raise-NOTICE behaviour.

-- 
Thomas Munro
http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: PgConf.US Hackers Track CFP
Next
From: Tom Lane
Date:
Subject: Re: Truncation of identifiers