Repository navigation
Quote schema and table separately in sql-insert and sql-update output - #1669
Open
jayhemnani9910 wants to merge 1 commit into
Open
jayhemnani9910 wants to merge 1 commit into
jayhemnani9910 wants to merge 1 commit into
Conversation
The table name was built as schema.table and then quoted once, so a query on public.people gave INSERT INTO "public.people", a table that does not exist.
This branch has not been deployed
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
For a query on a schema-qualified table,
\T sql-insertandsql-updatequote the schema and the table as one name:psql:
ERROR: relation "app.people" does not exist. The adapter built"{}.{}".format(schema, table)and then wrapped it in one pair of quotes. The schema and the table are now quoted on their own, giving"app"."people". A plain table still gives"people".Tested: new
test_output_sql_insert_quotes_schema_and_table_apartfails without the change;pytest tests(without features and the ssh tunnel test) 2674 passed, 2673 on main. Against PostgreSQL 18, the output forapp.peopleloads back with psql.Checklist
CONTRIBUTING.rst).changelog.rst.AUTHORSfile (or it's already there). It's added in Show arrays in Postgres format with the default data formats #1664.pip install pre-commit && pre-commit install).