Search Postgresql Archives

Re: non-static LIKE patterns

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

 



patrick keshishian <pkeshish@xxxxxxxxx> writes:
> Thanks for the quick reply. Would be tough choosing another
> "reasonable" ESCAPE character while dealing with paths. Will think
> more about this.

If you want it to be bulletproof, what I'd think about is something like

	WHERE second.path LIKE quote_like(first.path)||'%'

where quote_like() is a function that inserts a backslash before each
backslash, percent, and underscore in the given value.  Probably not
hard to cons that up from regexp_replace().

			regards, tom lane

-- 
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