Repository navigation
Conversation
Use quote_ident for COPY column lists so names like a-b work without manual double-quoting, matching copy_records_to_table behavior.
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
binary_copy_to_tablenow passes column names throughquote_identwhen building theCOPY table(col1, col2, ...)clause, so identifiers that need quoting (e.g.a-b) work without callers wrapping names in double quotes manually.Motivation and Context
copy_records_to_tablealready quoted column names;binary_copy_to_tablejoined raw strings and caused syntax errors for non-simple identifiers.Closes #71
How has this been tested?
python/tests/test_binary_copy_quoted_columns.py(table with"a-b", binary COPY withcolumns=["a-b"]).prek run -acargo fmt --checkandcargo clippy -p psqlpy --all-featureswith the CI warning flagspytest -vv --ignore=python/tests/test_ssl_mode.py: 262 passed against local PostgreSQL 16.test_ssl_mode.pywas not run locally (no SSL-enabled Postgres here); CI covers it.Types of changes
Checklist: