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

Update AbstractPostgresCompatibleDialect.java #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xushsh163
Copy link

When there is a conflict between a field name and a keyword in a PostgreSQL table, it is necessary to use quotation marks

When there is a conflict between a field name and a keyword in a PostgreSQL table, it is necessary to use quotation marks
Copy link
Contributor

@MartijnVisser MartijnVisser left a comment

Choose a reason for hiding this comment

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

@xushsh163 Thanks for the PR, can you please make sure that a test is added for this scenario. Ideally with a test we would be able to identify that this is indeed not working without your change

@xushsh163
Copy link
Author

@MartijnVisser
In postgresql 13.10
CREATE TABLE TEST( "LEFT" CHAR(20) );
In Flink 1.16.0 SQL-Client
CREATE TABLE test ( LEFT` STRING
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://xxxxx:5432/reporting',
'table-name' = 'test',
'username' = 'xxx',
'password' = 'xxx'
);

select * from test limit 10;`

Error:
[ERROR] Could not execute SQL statement. Reason:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "FROM"
Position: 13

@MartijnVisser
Copy link
Contributor

In postgresql 13.10

Yes, but I would like to see that added as a test in this PR, so it can be automatically included and validated in the future as well.

@xushsh163
Copy link
Author

@MartijnVisser Sorry, I am not a professional open-source maintainer, so it is difficult for me to write a standardized test case that meets your project's specifications. Perhaps you can treat this PR as an issue and fix it by your team. Then I will close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants