On 08/15/2013 10:16 PM, Robert James wrote: > How can I escape a string for LIKE operations? > > I want to do: > > SELECT * FROM t WHERE a LIKE b || '%' > > But I want be to interpreted literally. If b is 'The 7% Solution', I > don't want that '%' to be wildcard. I can't find an appropriate > function to escape it and any other potential wildcards for LIKE > clauses. In this particular case, you're better off changing the query to be SELECT * FROM t WHERE a >= b; but if your needs are more complex than your actual question, you'll most likely need to process b like Jeff explained. -- Vik -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general