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 71F145612C for ; Mon, 14 Mar 2005 06:18:23 +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 90886-06 for ; Mon, 14 Mar 2005 06:18:21 +0000 (GMT) Received: from hotmail.com (bay11-dav48.bay11.hotmail.com [64.4.39.78]) by svr1.postgresql.org (Postfix) with ESMTP id CFEC555EE3 for ; Mon, 14 Mar 2005 06:18:19 +0000 (GMT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sun, 13 Mar 2005 22:18:19 -0800 Message-ID: Received: from 218.94.87.252 by BAY11-DAV48.phx.gbl with DAV; Mon, 14 Mar 2005 06:18:19 +0000 X-Originating-IP: [218.94.87.252] X-Originating-Email: [gu_he@msn.com] X-Sender: gu_he@msn.com From: "Her Goo" To: Subject: sql: "LIKE" problem Date: Mon, 14 Mar 2005 14:16:19 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-OriginalArrivalTime: 14 Mar 2005 06:18:19.0922 (UTC) FILETIME=[9E15B720:01C5285D] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=4.882 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, FORGED_MUA_OUTLOOK, MSGID_FROM_MTA_HEADER X-Spam-Level: **** X-Archive-Number: 200503/184 X-Sequence-Number: 20663 I am using "postgresql-7.3.2-1" now! I met a problem when using "LIKE" in "WHERE" clause. For example, a table named "t_test", and its data looks like below: # SELECT * FROM t_test; id | c_name ----+-------- 1 | abc\ 2 | abc\de (2 rows) The thing I want to do is searching in above table and restricting the results to those that begin with string "abc\". The search result is: # SELECT * FROM t_test WHERE c_name LIKE 'abc\%'; id | c_name ----+-------- 1 | abc\ 2 | abc\de (2 rows) I want to go a step further, and restrict the results to those that begin with string "abc\d". The search result is: # SELECT * FROM t_test WHERE c_name LIKE 'abc\d%'; id | c_name ----+-------- (0 rows) I don't know why the result is "0 rows"(why not is "1 rows"), And I have trid "LIKE 'abc\\d%'", the result is also "0 rows". Is this a bug for "postgresql-7.3.2-1" ? Or how can I search a field when it contains a backslash('\') ? Thanks!!!