Weird "LIKE" behaviour

From: Andy Chambers <achambers(at)mcna(dot)net>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Weird "LIKE" behaviour
Date: 2012-07-06 20:16:33
Message-ID: CAAfW55r9LV-32m7z7tvFbQ2tpBrVt9MWz_+BC_L-Vdqgc8HMag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Below are two queries that should be pretty much the same but with the
first one, I'm trying to boil it down to a minimal test-case so I
don't have to export the table definition of dcm.providers. The first
one returns nothing but at least executes the query.

=> create table foo ( foo text );
=> select * from foo where foo like 'FOO%\'

The second one fails to execute the query...

=> select * from dcm.providers where lname like 'FOO%\'
ERROR: LIKE pattern must not end with escape character

Our server is 9.1.4 and can reproduce this behaviour with either 8.4
or 9.1 clients.

--
Andy Chambers
Software Engineer
(e) achambers(at)mcna(dot)net
(t) 954-682-0573

CONFIDENTIALITY NOTICE: This electronic mail may contain information
that is privileged, confidential, and/or otherwise protected from
disclosure to anyone other than its intended recipient(s). Any
dissemination or use of this electronic mail or its contents by
persons other than the intended recipient(s) is strictly prohibited.
If you have received this communication in error, please notify the
sender immediately by reply e-mail so that we may correct our internal
records. Please then delete the original message. Thank you.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2012-07-06 20:26:51 Re: Weird "LIKE" behaviour
Previous Message Gurjeet Singh 2012-07-06 19:25:37 Re: Primary key vs unique index