xataio / pgroll

PostgreSQL zero-downtime migrations made easy
https://www.xata.io
Apache License 2.0
2.97k stars 54 forks source link

Support create/drop index with uppercase names #356

Closed andrew-farries closed 3 months ago

andrew-farries commented 3 months ago

Fixes https://github.com/xataio/pgroll/issues/355

Postgres stores index names with uppercase characters in the pg_index catalog using the quoted version of the name. For example:

"idx_USERS_name"

whereas a lowercase index name would be stored as:

idx_users_name

This is different to how other object types are stored in their respective catalogs. For example, table names are stored in thepg_class catalog without quotes, regardless of whether they contain uppercase characters.

This makes it necessary to strip quotes from index names when retrieving them from the pg_index catalog when building the internal schema representation.