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

shardingsphere-proxy5.5 datasource is postgresql,when select keywaord an error is reported ,For example position keyword #33833

Closed
lijuchuan opened this issue Nov 28, 2024 · 6 comments

Comments

@lijuchuan
Copy link

problem:

select position from test;

error:
dhri=> select position from org_staff;
ERROR: You have an error in your SQL syntax: no viable alternative at input 'selectpositionfrom'

i changed to:
dhri=> select 'position' from org_staff;
?column?

position
position
position

@zzyReal666
Copy link
Contributor

zzyReal666 commented Nov 28, 2024

I had a similar problem in distSQL.Because my field is name, but name is the distSQL keyword.

@lijuchuan
Copy link
Author

I had a similar problem in distSQL.Because my field is name, but name is the distSQL keyword.

how do u solve it?

@zzyReal666
Copy link
Contributor

I had a similar problem in distSQL.Because my field is name, but name is the distSQL keyword.

how do u solve it?

I changed name to t_name.Because it's the most direct and the fastest.I have an untested idea.If you have to use keywords as column names, I'll try later to see if my idea solves this problem.

Copy link

github-actions bot commented Dec 5, 2024

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

@zzyReal666
Copy link
Contributor

Which version do you use, I use the latest version test can run select "position" from test;

real database ,both select position from test and select "position" from test success execute:
image

proxy database,only select "position" from test success execute:
image
image

@zzyReal666
Copy link
Contributor

Use double quotes instead of single quotes.

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

No branches or pull requests

4 participants