Disable using "LIKE" in visual data editor generated queries

Answered

I am using a visual data editor to update a Postgres database:

 

and everything worked perfectly until I changed the primary key to use a non-deterministic collation:

CREATE COLLATION case_insensitive (PROVIDER = icu, LOCALE = '@colStrength=secondary', DETERMINISTIC = FALSE);

Now I cannot use a visual data editor to edit the table because it generates the following query:

UPDATE public.users SET commentary = 'old' WHERE email LIKE 'ivan@email.com' ESCAPE '#';

 Which fails with the following error:

[0A000] ERROR: nondeterministic collations are not supported for LIKE

 To make it work, I would need to change the query

UPDATE public.users SET commentary = 'old' WHERE email = 'ivan@email.com';

 However, the generated query is read-only.

Questions:

1. Why "LIKE" is even used in this generated query? I tried removing the collation, and the query stays the same, so it is not related to the fact that the primary key has a non-deterministic collation

2. Is there a way to disable this behaviour and use plain equality instead of "LIKE" in queries?

3. If (2) is not possible, is there at least way to modify the query before executing it?

Thanks,

Ivan

0

Please sign in to leave a comment.