Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f2TGhqK47516; Thu, 29 Mar 2001 11:43:52 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f2TGhiw22660; Thu, 29 Mar 2001 11:43:44 -0500 (EST) To: Phuong Ma cc: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] inconsistent functionality with LIKE operator In-reply-to: <3AC2F17A.BFC50830@commandprompt.com> References: <3AC2F17A.BFC50830@commandprompt.com> Comments: In-reply-to Phuong Ma message dated "Thu, 29 Mar 2001 08:25:30 +0000" Date: Thu, 29 Mar 2001 11:43:43 -0500 Message-ID: <22657.985884223@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200103/1366 X-Sequence-Number: 6931 Phuong Ma writes: > I'm using PostgreSQL version 7.1, and I'm having trouble with the LIKE > statement. How would I find the value "a\bc"? I tried using the > backslash to escape it: LIKE 'a\\b%'; I think you need four backslashes. The string-literal parser eats one level of backslashes, but you need the pattern that arrives at LIKE to look like "a\\b%". BTW, "PostgreSQL version 7.1" does not exist yet. regards, tom lane