Re: LIKE - bug or expected behaviour?

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

Hello,

Tom Lane wrote:

>> 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'.

a very belated thank you very much for the explanation. So it matched
every view ending on the user's name ...
Makes me wonder whether this query was broken to begin with or did this
change with time / introduction of standard conforming strings?

Thank you very much,

Peter

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2009-10-18 02:23:19 Re: Error when running PG_DUMP
Previous Message Geoff Tolley 2009-10-16 21:12:47 Re: configuration kerberos in Postgre sql