On Fri, 12 Oct 2001 pgsql-bugs@postgresql.org wrote:
> Tom Cross (decius@whack.org) reports a bug with a severity of 2
> The lower the number the more severe it is.
>
> Short Description
> problem with LIKE pattern matches involving % and \_
>
> Long Description
> The following pattern matches do not work:
>
> LIKE '%\_%'
> LIKE '%\_'
> LIKE '\_%'
I think you need to double the backslashes, so
'%\\_%' searches for anything with an underscore.