Escape string for LIKE op - Mailing list pgsql-general

From Robert James
Subject Escape string for LIKE op
Date
Msg-id CAGYyBggb1uvuFRBE4=AJaUtNhohU2qFfaUT4iYXAta6_YpFkWw@mail.gmail.com
Whole thread Raw
Responses Re: Escape string for LIKE op  (Jeff Janes <jeff.janes@gmail.com>)
Re: Escape string for LIKE op  (Vik Fearing <vik.fearing@dalibo.com>)
List pgsql-general
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.


pgsql-general by date:

Previous
From: Andrew Berman
Date:
Subject: Re: Streaming Replication Randomly Locking Up
Next
From: Darren Duncan
Date:
Subject: Re: Immediate Constraints