Re: LIKE - bug or expected behaviour?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jan-Peter Seifert" <Jan-Peter(dot)Seifert(at)gmx(dot)de>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: LIKE - bug or expected behaviour?
Date: 2009-10-05 13:59:33
Message-ID: 6612.1254751173@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Jan-Peter Seifert" <Jan-Peter(dot)Seifert(at)gmx(dot)de> writes:
> Strangely the following select:

> SELECT table_name FROM information_schema.views WHERE table_schema = current_schema() AND table_name LIKE '\_%\_username';

> does also match views with names like table_username.

Unless you have standard_conforming_strings turned on, those backslashes
are going to be eaten by the string-literal parser. So the LIKE code
just sees '_%_username'.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Aras Angelo 2009-10-05 22:42:50 idle connections
Previous Message Jan-Peter Seifert 2009-10-05 13:35:22 LIKE - bug or expected behaviour?