prepare in a do loop

Поиск
Список
Период
Сортировка
От Marc Millas
Тема prepare in a do loop
Дата
Msg-id CADX_1aa2ZT2aCZJuG4NLZjgUt-QiBiY+P5nKsBSegyhLAq8-jw@mail.gmail.com
обсуждение исходный текст
Ответы Re: prepare in a do loop  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: prepare in a do loop  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: prepare in a do loop  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,

in psql, with a postgres 12.5 db on a centos 7 intel:
I do create a function named randname() returning a varchar, and a table matable with a column prenom varchar(50). then
postgres=# prepare moninsert(varchar) as
postgres-# insert into matable(prenoms) values($1);
PREPARE

I test it:
postgres=# execute moninsert(randname());
INSERT 0 1

up to now, everything fine. then:
do $$ begin for counter in 1..1000000 loop execute moninsert(randname());end loop;end;$$;
ERREUR:  la fonction moninsert(character varying) n'existe pas
LIGNE 1 : SELECT moninsert(randname())

someone can explain ?

thanks

(its a french db, so error message in french :-)

Marc MILLAS
Senior Architect
+33607850334

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: ADD FOREIGN KEY fails, but the records exist
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: prepare in a do loop