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

Update check for table existence to be case insensitive #2086

Merged
merged 2 commits into from
Jun 24, 2017

Conversation

dlstadther
Copy link
Collaborator

Description

Redshift schema/table/column names are case-insensitive. So if you create table MyTable in schema MySchema, redshift saves those values in pg_table_def and information_schema.tables in all lowercase. Therefore, the check for table existence in does_table_exist() will fail.

This PR just surrounds the table and schema parameters in lower().

From Redshift documentation:

ASCII letters in standard and delimited identifiers are case-insensitive and are folded to lower case.

Motivation and Context

Resolves Issue #2080

Have you tested this? If so, how?

Works for me.

@mention-bot
Copy link

@dlstadther, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ddaniels888, @rantav and @steenzout to be potential reviewers.

@dlstadther
Copy link
Collaborator Author

@Tarrasch All tests passed except the two which haven't been running for anyone.

@Tarrasch Tarrasch merged commit 8874b93 into spotify:master Jun 24, 2017
@Tarrasch
Copy link
Contributor

Cool, also feel free self-merge these changes to an area where you have expertise.

@dlstadther dlstadther deleted the redshift_insensitive branch June 29, 2017 02:17
@dlstadther
Copy link
Collaborator Author

@Tarrasch I would have, but my write access to this repo was removed.

Thanks for merging!

This was referenced Jun 29, 2022
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.

3 participants