citusdata / pg_shard

ATTENTION: pg_shard is superseded by Citus, its more powerful replacement
https://github.com/citusdata/citus
GNU Lesser General Public License v3.0
1.06k stars 63 forks source link

Check column name length in ColumnNameToColumn #105

Closed jasonmp85 closed 9 years ago

jasonmp85 commented 9 years ago

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.

onderkalaci commented 9 years ago

Hey @jasonmp85,

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.