Re: Find \ in text - Mailing list pgsql-general

From John R Pierce
Subject Re: Find \ in text
Date
Msg-id 4C86B991.6000802@hogranch.com
Whole thread Raw
In response to Re: Find \ in text  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-general
  On 09/07/10 2:44 PM, Steve Crawford wrote:
>> Any other suggestions?
>
> ... like E'%\\\\%'
>

and, for extra fun, if that SQL statement is a constant string in a C or
similar programming language, you may well need to double up those \'s
again so that SQL sees them as the C/C++/etc parser itself does \ escaping.

     sql_command = "select MM_PATH_FILE from MULTI_MEDIA Where
MM_PATH_FILE NOT ILIKE E'%\\\\\\\\%';"



Seriously, MS Windows programmers really really should use / for
paths... the windows API's are all perfectly happy with these.  only the
command parser insists on \ as a path delimiter.



pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Find \ in text
Next
From: Tom Lane
Date:
Subject: Re: Empty SELECT result at simultaneous calls