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

Support '_' as escape char in LIKE #16093

Open
TennyZhuang opened this issue Apr 2, 2024 · 4 comments
Open

Support '_' as escape char in LIKE #16093

TennyZhuang opened this issue Apr 2, 2024 · 4 comments
Labels

Comments

@TennyZhuang
Copy link
Contributor

Currently, we banned _ as escape char in LIKE expression, since the output is not as expected.

The failed regress tests (commented):

--@ SELECT 'bear' LIKE 'b_ear' ESCAPE '_' AS "true";
--@ SELECT 'bear' NOT LIKE 'b_ear' ESCAPE '_' AS "false";
@github-actions github-actions bot added this to the release-1.8 milestone Apr 2, 2024
@TennyZhuang TennyZhuang added the good first issue Good for newcomers label Apr 2, 2024
Copy link
Contributor

github-actions bot commented Jun 8, 2024

This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned.

@Max-Cheng
Copy link
Contributor

@TennyZhuang new here. can i pick this?

@TennyZhuang
Copy link
Contributor Author

@TennyZhuang new here. can i pick this?

Sure, thanks!

@Max-Cheng
Copy link
Contributor

Max-Cheng commented Jun 20, 2024

@TennyZhuang I got some weird behavior on this featrue deplyment #17377. Such as

SELECT '____' LIKE '_____' ESCAPE '_' as "true"

In PostgreSQL 16.3 will return

ERROR:  LIKE pattern must not end with escape character

But , in otherwise this query should be return true.

In other test case should return true but reutrn false

postgres=# SELECT '____r' LIKE '_____r' ESCAPE '_' as "true";
 true
------
 f
(1 row)

I throught this feature need more cornercase to verify.

@fuyufjh fuyufjh removed this from the release-1.10 milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants