-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[YSQL] ysql_dump should consistently use quotes on column names #6061
Comments
We can utilize --quote-all-identifiers option. Though there is code change required. Or, calling fmtId() is simpler fix. |
@tedyu
It used quotes on |
There used to be code change shown in my previous comment. See the above PR for the current proposal. |
Summary: As reported in #6061, currently the primary key column(s) in sql_dump output may not be properly quoted, leading to invalid SQL syntax. This change utilizes fmtId to properly quote the column. Test Plan: Create table as shown in issue #6061, run sql_dump over the DB and observe proper quoting: ``` CREATE TABLE public.chat_user ( "chatID" text NOT NULL, PRIMARY KEY(("chatID") HASH) ); ``` Reviewers: oleg, mihnea Reviewed By: mihnea Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D9639
@tedyu note that this isn't still available in 2.5.0.0 (just tested). Tried with |
This is fixed but didn't enter 2.5.0.0 because of a mistaken commit tagging. It will be in the release. (verified that it works on master). |
On 2.3.2.0:
1.
Which is not valid even in normal PostgreSQL:
The column names have to be inside/outside quotes in both cases.
The text was updated successfully, but these errors were encountered: