Truncation of identifiers

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Truncation of identifiers
Date: 2016-01-13 22:26:48
Message-ID: CAEepm=16Gcuu1WRk5-jqheMvNxOSZ_c98vMKC1qDwOiNBR-Z0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-01-14 00:05:30 Re: Truncation of identifiers
Previous Message Joshua D. Drake 2016-01-13 22:02:36 PgConf.US Hackers Track CFP