2021年4月8日星期四

How do I translate this PostgreSQL regular expression (case insensitive) query into an ILIKE query?

I have a query that currently uses PostgresQL...

.where("locations.address ~* '#{@street_name}.*#{@street_type}'")  

In order to prevent special characters being interpreted when this lookup is performed, I need to use an ILIKE query instead.

I'm not sure what this part of the query does and therefore how to translate it

.*  

Can someone help me understand how to translate this query to an ILIKE query without breaking how the current query is constructed?

https://stackoverflow.com/questions/67014142/how-do-i-translate-this-postgresql-regular-expression-case-insensitive-query-i April 09, 2021 at 10:08AM

没有评论:

发表评论