Juanse
Juanse

Reputation: 95

Amazon RDS + PostgreSQL + accent + like

I'm having a lot of troubles using the configuration described in the title.

My problem :

For example, my search is : SELECT * FROM cim10 WHERE description LIKE '%anémie%' ORDER BY weight DESC which works fine.

The problem is when I want to have the same results looking for '%anemie%' (without the accent).

I found that AWS RDS has the module unaccent installed which could solve my problems but when I try it I have an error in my lambda function :

enter image description here

Someone can help me find out the solution ? Thank you very much

Upvotes: 0

Views: 1163

Answers (1)

Juanse
Juanse

Reputation: 95

So, after posting the question I found the answer https://amzn.to/2yg6PWm :

You have to activate the extension by doing CREATE EXTENSION [extension name]

Then you can use it like this : SELECT * FROM cim10 WHERE unaccent(description) LIKE unaccent('%' || [string you are looking for] || '%')

Upvotes: 2

Related Questions