DevHeads.net

Escaped characters in LIKE

PostgreSQL fully supports escaping of %, _ and \ in LIKE clauses, and supports the standard syntax for indicating the use of an escaping character: <a href="https://www.postgresql.org/docs/9.0/functions-matching.html" title="https://www.postgresql.org/docs/9.0/functions-matching.html">https://www.postgresql.org/docs/9.0/functions-matching.html</a>.

The ODBC driver correctly supports the standard ODBC 'escape' syntax for declaring the escaping character: (convert.c, line 5580).

So is there some reason I'm missing why the SQLGetInfo implementation, when asked SQL_LIKE_ESCAPE_CLAUSE, says that the driver doesn't support escaping of LIKE? (info.c, line 309). There is a comment in the code that indicates that the author wasn't aware of the SQL syntax ('is there a character that escapes '%' and '_' in a LIKE clause? not as far as I can tell').