Re: select exact term

Поиск
Список
Период
Сортировка
От Marc Fromm
Тема Re: select exact term
Дата
Msg-id 93361C67E4EE844A80935863A4FF4B6C0632FCB9@Exch2010MB-2.univ.dir.wwu.edu
обсуждение исходный текст
Ответ на Re: select exact term  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
Thanks Tom, I just discovered that. I reworked the php so the quotes surround the regexp.

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Thursday, March 28, 2013 1:07 PM
To: Marc Fromm
Cc: Craig James; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] select exact term

Marc Fromm <Marc.Fromm@wwu.edu> writes:
> I am struggling with the syntax. In php I create my where clause as shown, using ~* for case insensitive:
> $search = "art";
> $strSQL2 = "WHERE (title ~* [[:<:]]'$search'[[:>:]] OR description ~*
> [[:<:]]'$search'[[:>:]]) ";

> When executed zero records are returned even though the ILIKE statement shown below returns records that do have the
wordart. 

Your php app must not be bothering to check for errors :-( ... that's invalid SQL syntax.  The bracket constructs are
partof the regexp string and need to be inside the single quotes. 

            regards, tom lane



В списке pgsql-admin по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: select exact term
Следующее
От: Sergey Konoplev
Дата:
Сообщение: Re: select exact term