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

identifier quote check is incorrect when passing mixed-case names #157

Open
urkle opened this issue Aug 12, 2024 · 3 comments
Open

identifier quote check is incorrect when passing mixed-case names #157

urkle opened this issue Aug 12, 2024 · 3 comments

Comments

@urkle
Copy link

urkle commented Aug 12, 2024

the identifier function checks to see if the passed identifier contains non alpha and non-numeric contents. However it should be checking the case of the alpha characters as well.

# what it does right now
identifier('myAwesomeTable') == 'myAwesomeTable'
# what it should do
identifier('myAwesomeTable') == '"myAwesomeTable"'

Otherwise Postgres case-folds the identifier (myAwesomeTable -> myawesometable) and the select query fails.

@tlocke
Copy link
Owner

tlocke commented Aug 15, 2024

Hi @urkle, thanks for raising this. On balance I think you're right, so I've changed the behaviour here 91b0094

@urkle
Copy link
Author

urkle commented Aug 16, 2024

@tlocke thanks for the quick response!.

Generally IMO I just have quote everything 100% of the time but this change should work fine.

@tlocke
Copy link
Owner

tlocke commented Aug 17, 2024

You're right, I think it's best if it just quotes everything, so I've made that change 0a75f1c

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

No branches or pull requests

2 participants