append all columns in where-clause

Поиск
Список
Период
Сортировка
От Peter Pilsl
Тема append all columns in where-clause
Дата
Msg-id 20010418232654.C91421@i3.atat.at
обсуждение исходный текст
Ответы Re: append all columns in where-clause  (will trillich <will@serensoft.com>)
Список pgsql-general
for doing a simple full text-search I add the following where-clause:

select c1,c2,c3...,c9 from table where c1||c2||c3 .. ||c9 ~ 'searchtext';

This seems to work even with integers or timestamps. Unfortunately it does not work with char-fields:

 author    | varchar(100)  |
 valid     | char(1)       |

#select author||valid from table;
ERROR:  Unable to identify an operator '||' for types 'varchar' and 'bpchar'
        You will have to retype this query using an explicit cast

Is there any way to ship around this problem or any more correct way
to avoid such errors in the future with different types.

thnx,

peter



--
mag. peter pilsl

phone: +43 676 3574035
fax  : +43 676 3546512
email: pilsl@goldfisch.at
sms  : pilsl@max.mail.at

pgp-key available

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Passing a row (NEW) as function argument
Следующее
От: "Oliver Elphick"
Дата:
Сообщение: Re: Inheritance question