Re: BUG #14512: Backslashes in LIKE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: vojta(dot)rylko(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14512: Backslashes in LIKE
Date: 2017-01-24 18:02:25
Message-ID: 23478.1485280945@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

vojta(dot)rylko(at)gmail(dot)com writes:
> Hi, LIKE behaves differently depending on left side.

>> select 1 where '\' like '\\\'; -- one and three backslashes
> ?column?
> ----------
> (0 rows)

>> select 1 where '\\' like '\\\'; -- two and three backslashes
> ERROR: LIKE pattern must not end with escape character

I see no bug here. The pattern is wrong, but it happens not to notice in
the first case because it never reaches the buggy part of the pattern.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2017-01-24 18:15:08 Re: BUG #14512: Backslashes in LIKE
Previous Message David G. Johnston 2017-01-24 17:48:09 Re: BUG #14512: Backslashes in LIKE