Re: fulltext search udf

Поиск
Список
Период
Сортировка
От Andreas Wenk
Тема Re: fulltext search udf
Дата
Msg-id 4A300808.3030901@netzmeister-st-pauli.de
обсуждение исходный текст
Ответ на Re: fulltext search udf  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> Andreas Wenk <a.wenk@netzmeister-st-pauli.de> writes:
>>          EXECUTE 'INSERT INTO produkte
>> (art_nr,bezeichnung,beschreibung,preis,steuersatz,aktionspreis,stichworte,vector)
>>                  VALUES
>> ('''||art_nr||''','''||bezeichnung||''','''||beschreibung||''','||preis||',
>>                     '||steuersatz||','||aktionspreis||','''||stichworte||''','||vect||')';
>
> This is not going to work with such a half-baked approach to quoting the
> data values --- any value with ' or \ in it will break it.  You could
> use quote_literal(), but I wonder why you are bothering with EXECUTE at
> all.  If you just did the INSERT directly it would run faster and be a
> lot less ugly.
>
>             regards, tom lane
Tom, thanks for the hint! I was really doing the wrong thing. There have
been even more errors what made me confused. Now I got it ...

Cheers

Andy

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

Предыдущее
От: Pedro Doria Meunier
Дата:
Сообщение: Re: Average connections
Следующее
От: "Atul Chojar"
Дата:
Сообщение: Different handling of PL/pgSQL for-loop variables in 8.3.7 vs. 8.2.7 ???