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

sqlglot removes options from the regexp_replace function #3393

Closed
rzykov opened this issue May 1, 2024 · 1 comment · Fixed by #3394
Closed

sqlglot removes options from the regexp_replace function #3393

rzykov opened this issue May 1, 2024 · 1 comment · Fixed by #3394
Assignees

Comments

@rzykov
Copy link

rzykov commented May 1, 2024

Hey, I have a problem. Sqlglot removes options from the regexp_replace function when translating from a Postgres script to a duckdb one.

Fully reproducible code snippet

sqlglot.transpile("select regexp_replace('mr .', '[^a-zA-Z]', '', 'g')", read="postgres", write="duckdb")[0]
"SELECT REGEXP_REPLACE('mr .', '[^a-zA-Z]', '')"

Official Documentation
DuckdDb regexp_replace https://duckdb.org/docs/sql/functions/regular_expressions.html#using-regexp_replace
Postgres: https://www.postgresql.org/docs/current/functions-matching.html#:~:text=The%20regexp_replace%20function%20provides%20substitution,be%20given%20in%20any%20case.)

@rzykov
Copy link
Author

rzykov commented May 2, 2024

Thank you so much!

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

Successfully merging a pull request may close this issue.

2 participants