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 55B39329E67 for ; Thu, 23 Sep 2004 00:17:40 +0100 (BST) 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 69922-07 for ; Wed, 22 Sep 2004 23:17:32 +0000 (GMT) Received: from pimout5-ext.prodigy.net (pimout5-ext.prodigy.net [207.115.63.73]) by svr1.postgresql.org (Postfix) with ESMTP id 8C440329E6F for ; Thu, 23 Sep 2004 00:17:33 +0100 (BST) Received: from [192.168.1.207] (167.95.252.64.snet.net [64.252.95.167]) by pimout5-ext.prodigy.net (8.12.10 milter /8.12.10) with ESMTP id i8MNHWBq099986; Wed, 22 Sep 2004 19:17:32 -0400 Message-ID: <41520882.6020702@kencast.com> Date: Wed, 22 Sep 2004 19:19:30 -0400 From: Wei Weng User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: pgsql-sql@postgresql.org Subject: Re: LIKE operator and string comparison References: <415202B6.7060903@kencast.com> <19606.1095894584@sss.pgh.pa.us> In-Reply-To: <19606.1095894584@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/203 X-Sequence-Number: 19049 Tom Lane wrote: > Wei Weng writes: > >>But if I choose to use string comparison, instead of 4 escape characters, I >>only need 2. > > >>Why is that? > > > Backslash is an escape character for LIKE. > > regards, tom lane > > What about in regular strings? I do need to use backslash to escape the other backslash in order to get the '\'. Why isn't that the case in LIKE operation? Thanks Wei