X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CF73D5639E for ; Mon, 14 Mar 2005 07:32:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09257-07 for ; Mon, 14 Mar 2005 07:32:15 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id EE23156399 for ; Mon, 14 Mar 2005 07:32:13 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j2E7WDQR006087; Mon, 14 Mar 2005 02:32:13 -0500 (EST) To: "Her Goo" Cc: pgsql-sql@postgresql.org Subject: Re: sql: "LIKE" problem In-reply-to: References: Comments: In-reply-to "Her Goo" message dated "Mon, 14 Mar 2005 14:16:19 +0800" Date: Mon, 14 Mar 2005 02:32:12 -0500 Message-ID: <6086.1110785532@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/186 X-Sequence-Number: 20665 "Her Goo" writes: > I want to go a step further, and restrict the results to those > that begin with string "abc\d". You need four backslashes for that, because \ is special to both the string literal parser and the LIKE operator. So '\\\\' reduces to a string constant containing \\, and then the LIKE operator sees that as a quoted backslash. regards, tom lane