Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support create/drop index with uppercase names #356

Merged
merged 4 commits into from
May 16, 2024

Conversation

andrew-farries
Copy link
Collaborator

Fixes #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.

Quote index names in index operations to avoid issues with case
sensitivity.
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 the
`pg_class` catalog without quotes, regardless of whether they contain
uppercase characters.
@andrew-farries andrew-farries merged commit a87fa36 into main May 16, 2024
44 checks passed
@andrew-farries andrew-farries deleted the drop-index-case-sensitivity branch May 16, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

drop_index operation quoting issue
2 participants