Had an interesting bug involving #postgresql today.
Identifiers (table names, column names, other named things) can only be 63 characters long. We had some materialized views that were longer, some of which shared the same prefix. So like: "calculations_for_xxxx" and "calculations_for_yyyy" but much longer. Still unique though.
We didn't know this and changed the name of the view. "What could go wrong?" we thought.
@edward It's not only table names, it's also column names, etc.
It can be changed by compiling PostgreSQL.
Other RDBMS have other maximum length for identifiers:
- SQL Server 124
- MySQL 64
- Oracle 30
The #PostgreSQL limits are documented here https://www.postgresql.org/docs/current/limits.html
@sjstoelting I listed column names and other things in the original post
We saw that we could recompile and raise the limit, but we didn’t want to do that. It’s a bunch of work and we didn’t want to run into edge cases.
I didn’t know the limits for other RDBMS. That’s interesting, thanks!