Re: fulltext search udf

From: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: fulltext search udf
Date: 2009-06-10 19:22:48
Message-ID: 4A300808.3030901@netzmeister-st-pauli.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Atul Chojar 2009-06-10 20:23:39 Different handling of PL/pgSQL for-loop variables in 8.3.7 vs. 8.2.7 ???
Previous Message Pedro Doria Meunier 2009-06-10 18:14:14 Re: Average connections