Skip to content

Redshift escape string literal logic. #28

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

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

zdenal
Copy link

@zdenal zdenal commented Feb 26, 2024

Why

We want to be able accept in regexp escaped string literals.

Copy link
Collaborator

@lustefaniak lustefaniak left a comment

Choose a reason for hiding this comment

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

Looks good but did you verify escape rules with the docs? I'm a little bit surprised it doesn't behave in same way as Postgres as normally you connect to resist using Postgres driver 🤔

@zdenal
Copy link
Author

zdenal commented Feb 27, 2024

@lustefaniak TBH I didn't find doc about escaping sequences for redshift. If you have some could you provide a link please 🙏 .

But I couldn't do it like Postgresql as Postgresql doesn't have escaping behaviour in source code. Also I am not sure how similar are these 2 languages are. Postgresql has escaping singliquote by '' where redshift by example you provided has \' (and also by some others I found).
They are mentioning Postgres vs Mysql difference also in origin PR to Mysql escaping (apache#373 (comment)), so I think it doesn't need to be same as for redshift also.

Also by checking dialects (postgres and reshift) in source code they are kind of different related to identifiers logic and so on (what is also related with qouting logic).

@zdenal zdenal merged commit d8b43a9 into main Feb 27, 2024
@zdenal zdenal deleted the zdenko/redshift-escape-string-literal branch February 27, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants