Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update: Add Support for PostgreSQL v13 #1180

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

codebreaker32
Copy link

@codebreaker32 codebreaker32 commented Mar 21, 2025

Problem:

  1. In postgres v13, SIMILAR TO .. ESCAPE NULL explicitly returns null
  2. Improper implementation of ESCAPE in PostgresToStringVisitor.java

Implementation

  • Modified SIMILAR TO ... ESCAPE NULL to avoid explicit NULL returns in PostgreSQL v13
    -- In postgres v12 ESCAPE NULL
  • Fixed usage of SIMILAR TO in the codebase

-- In previous version, visit function didn't append "ESCAPE" to the query.

public void visit(PostgresSimilarTo op) {
sb.append("(");
visit(op.getString());
sb.append(" SIMILAR TO ");
visit(op.getSimilarTo());
if (op.getEscapeCharacter() != null) {
visit(op.getEscapeCharacter());
}
sb.append(")");
}

  • Add configuration parameters in RESET (TODO task)

Partially resolves #912

Reference : Postgres Release Notes v13

Aman added 2 commits March 22, 2025 00:36
- Modified "SIMILAR TO .... ESCAPE NULL" to avoid explicit NULL returns in PostgreSQL v13
- Fixed usage of `SIMILAR TO` in the codebase
@codebreaker32
Copy link
Author

Hey @mrigger
Please review and tell me if I need to change anything......

@codebreaker32
Copy link
Author

codebreaker32 commented Mar 23, 2025

Hi @mrigger

I have made following changes:-

  • Used getchar() from Randomly for generating escape character
  • For now I have removed RESET configParameter, I will implement this change in next PR

@codebreaker32
Copy link
Author

Hi @mrigger please review!

@codebreaker32 codebreaker32 requested a review from mrigger April 2, 2025 09:39
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 this pull request may close these issues.

Add support for Postgres v13
2 participants