Received: from joeconway.com (unknown [63.210.180.150]) by postgresql.org (Postfix) with ESMTP id D6BD6475985 for ; Thu, 25 Apr 2002 12:23:03 -0400 (EDT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 3.5.6) with ESMTP-TLS id 344253; Thu, 25 Apr 2002 08:17:15 -0700 Message-ID: <3CC82D65.9010809@joeconway.com> Date: Thu, 25 Apr 2002 09:23:01 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.9) Gecko/20020311 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Helge Kreutzmann Cc: pgsql-sql@postgresql.org Subject: Re: Proper quoting of \e ? References: <20020425122253.A29150@itp.uni-hannover.de> <200204251547.g3PFlG317946@candle.pha.pa.us> <20020425175718.B31354@itp.uni-hannover.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200204/309 X-Sequence-Number: 7573 Helge Kreutzmann wrote: > Well, the "\" is part of the strings to be outputed, so I did not > intend to quota anything. If I replace \ to \\ in my first query, I > get also no result. > I think you need 4 '\'s: test=# create table written_by(title text); CREATE test=# insert into written_by values('An equation of state {\\em \\\`a la} Carnahan-Starling'); INSERT 16661 1 test=# select * from written_by; title ----------------------------------------------------- An equation of state {\em \`a la} Carnahan-Starling (1 row) test=# SELECT title from written_by where title like 'An equation of state {\\\\e%'; title ----------------------------------------------------- An equation of state {\em \`a la} Carnahan-Starling (1 row) This is because the string literal parser reduces '\\\\' to '\\', and then the backend function which implements LIKE interprets '\\' as '\'. HTH, Joe