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

Postgres copy explicates columns and column order #1137

Merged
merged 5 commits into from
Oct 15, 2024

Conversation

austinweisgrau
Copy link
Collaborator

Without this change, the Postgres copy method only works if the Table has the same columns in the same order as the destination table. With this change, the source table can have a subset of columns in a different order but still successfully load to the destination table.

@austinweisgrau austinweisgrau force-pushed the pg_copy branch 2 times, most recently from a858cc0 to ba56c50 Compare September 21, 2024 01:34
@austinweisgrau austinweisgrau force-pushed the pg_copy branch 3 times, most recently from cfc231a to 5587233 Compare October 10, 2024 15:58
@austinweisgrau
Copy link
Collaborator Author

Also now includes a couple other changes that make the Postgres query methods more robust:

  • get_updated_rows() can now handle cutoff_value being None which happens sometimes
  • a few Postgres query methods are able to handle case-sensitive column and table names, which happens sometimes

Necessary in certain situations, e.g. table name has capital letters
Some tables have uppercase letters in their name
Some postgres columns (e.g. if they have a capital letter) need to be
surrounded by double quotes
without this change, the query fails to parse
Copy link
Collaborator

@shaunagm shaunagm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, sorry for the delay

@shaunagm shaunagm merged commit 99decfa into move-coop:main Oct 15, 2024
69 checks passed
@austinweisgrau austinweisgrau deleted the pg_copy branch October 16, 2024 01:01
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