Skip to content

Escape username and database name in PostgreSQL procedures #340

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

Merged
merged 1 commit into from
Apr 20, 2022
Merged

Escape username and database name in PostgreSQL procedures #340

merged 1 commit into from
Apr 20, 2022

Conversation

aaaronan
Copy link
Contributor

Valid database names and usernames might have upper case characters. However, if
they are passed without proper escaping PostgreSQL will end up referencing the
name using wrong case and later the procedure will error on not finding the
correct username or database name.

Fix this by using double quotes when passing usernames or database names.

All new code of the whole pull request, including one or several files that are
either new files or modified ones, are contributed under the BSD-new license. I
am contributing on behalf of my employer Amazon Web Services, Inc.

Valid database names and usernames might have upper case characters. However, if
they are passed without proper escaping PostgreSQL will end up referencing the
name using wrong case and later the procedure will error on not finding the
correct username or database name.

Fix this by using double quotes when passing usernames or database names.

All new code of the whole pull request, including one or several files that are
either new files or modified ones, are contributed under the BSD-new license. I
am contributing on behalf of my employer Amazon Web Services, Inc.
@sm-shaw
Copy link
Contributor

sm-shaw commented Apr 20, 2022

I have tested the changes for TPROC-C & H for build and test and all work fine. Recommend to accept.

@sm-shaw
Copy link
Contributor

sm-shaw commented Apr 20, 2022

Merging Pull Request as voted on by TPC-OSS subcommittee on April 20, 2022.

@sm-shaw sm-shaw merged commit 1eb9984 into TPC-Council:master Apr 20, 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.

2 participants