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

Non-ASCII characters in identifiers without quotes raise ParseException (PostgreSQL). #249

Open
a1ea321 opened this issue Aug 8, 2024 · 3 comments

Comments

@a1ea321
Copy link

a1ea321 commented Aug 8, 2024

This works in PostgreSQL 16:

create view public.delete→me as (select 42);
select * from public.delete→me;

So I expected this to work as well:

from mo_sql_parsing import parse as p
p('select * from public.delete→me;')

But it raises a ParseException. With quotations it works fine:

 p('select * from public."delete→me";')

But I don't want to use quotation marks. It may be that mo-sql-parsing is trying to nudge me towards better practices, of course. :)

pip show mo-sql-parsing says: Version: 10.652.24214

@klahnakoski
Copy link
Owner

@a1ea321 thank you for these. I was away this past week. I will look at them this weekend.

@klahnakoski
Copy link
Owner

It may be that mo-sql-parsing is trying to nudge me towards better practices

Nah, it is just a parser without opinions 😄

@klahnakoski
Copy link
Owner

@a1ea321,

The general solution to this is difficult. The underlying parser generator relies on the very few ascii characters to speed up parsing. If there is a specific block of unicode you are interested in, that can be added simply enough.

I will continue to look into adding unicode support to the parser.

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

No branches or pull requests

2 participants