Re: LIKE - bug or expected behaviour? - Mailing list pgsql-admin

From Tom Lane
Subject Re: LIKE - bug or expected behaviour?
Date
Msg-id 6612.1254751173@sss.pgh.pa.us
Whole thread Raw
In response to LIKE - bug or expected behaviour?  ("Jan-Peter Seifert" <Jan-Peter.Seifert@gmx.de>)
Responses Re: LIKE - bug or expected behaviour?  (Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>)
List pgsql-admin
"Jan-Peter Seifert" <Jan-Peter.Seifert@gmx.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

pgsql-admin by date:

Previous
From: "Jan-Peter Seifert"
Date:
Subject: LIKE - bug or expected behaviour?
Next
From: Aras Angelo
Date:
Subject: idle connections