Discovered that system cache lookups have Asserts that fail if any name over NAMEDATALEN is provided. This change gives a nicer behavior than just crashing the whole backend.
I also discovered that ResolveRelationId silently truncates its input, which I initially thought I'd fix. It appears many functions that use the name data type also silently truncate their input, so I left that as-is. At any rate, it accepts a qualified name (delimited by periods), so detecting whether any given part of that is too long is more trouble than it's worth, especially when other pieces of PostgreSQL proper truncate regardless.
I looked and tested the change. I have a tiny comment on the error message. If that makes sense, we can change it. Or, we can just leave it as it is, and ship it.
Discovered that system cache lookups have Asserts that fail if any name over
NAMEDATALEN
is provided. This change gives a nicer behavior than just crashing the whole backend.I also discovered that
ResolveRelationId
silently truncates its input, which I initially thought I'd fix. It appears many functions that use thename
data type also silently truncate their input, so I left that as-is. At any rate, it accepts a qualified name (delimited by periods), so detecting whether any given part of that is too long is more trouble than it's worth, especially when other pieces of PostgreSQL proper truncate regardless.