Search Postgresql Archives

Re: non-static LIKE patterns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 11, 2012 at 4:07 PM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
> patrick keshishian <pkeshish@xxxxxxxxx> writes:
>> I need to match entries in second table to the first, so I use the
>> following in my WHERE clause:
>>       ... WHERE second.path LIKE first.path||'%'
>> This seemed to work at first, but it fails if the paths use
>> back-slashes (like Windows paths).
>
> By default, back-slash is a special character in LIKE patterns.
> You can change that with the ESCAPE option.  See
> http://www.postgresql.org/docs/devel/static/functions-matching.html#FUNCTIONS-LIKE

Thanks for the quick reply. Would be tough choosing another
"reasonable" ESCAPE character while dealing with paths. Will think
more about this.

Cheers,
--patrick

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux