Re: fulltext search udf - Mailing list pgsql-general

From Andreas Wenk
Subject Re: fulltext search udf
Date
Msg-id 4A300808.3030901@netzmeister-st-pauli.de
Whole thread Raw
In response to Re: fulltext search udf  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Pedro Doria Meunier
Date:
Subject: Re: Average connections
Next
From: "Atul Chojar"
Date:
Subject: Different handling of PL/pgSQL for-loop variables in 8.3.7 vs. 8.2.7 ???