How to run a stored PL/pgSQL function?

Поиск
Список
Период
Сортировка
От Ken Winter
Тема How to run a stored PL/pgSQL function?
Дата
Msg-id 004d01c5f628$a2ed1ba0$6603a8c0@kenxp
обсуждение исходный текст
Ответы Re: How to run a stored PL/pgSQL function?  (Michael Glaesemann <grzm@myrealbox.com>)
Re: How to run a stored PL/pgSQL function?  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-general

How can I cause a PL/pgSQL function to be executed from a SQL script?

 

I know how to invoke a function using a trigger, but I don’t know any other way.

 

I’m looking at the SQL Command Reference at http://www.postgresql.org/docs/7.4/static/sql-commands.html, but the only command that looks like a candidate to do this, namely EXECUTE, seems to use only the result of a PREPARE statement, which in turn can only accept a SELECT, INSERT, UPDATE, or DELETE statement as input, according to http://www.postgresql.org/docs/7.4/static/sql-prepare.html.

 

I’m not sure if I’m clearly saying what I need to do.  I have a PL/pgSQL “foo (varchar)”.  I have a script containing a bunch of DDL statements.

 

Somewhere in that script, I want to call or invoke (or whatever the right verb is) foo and provide its argument, so that when the script is being executed, at that point foo is executed and has its desired effect on the database.  (I don’t need any return from foo.)  But I don’t know what to put into the script to make this happen.

 

~ TIA

~ Ken

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

Предыдущее
От: "Thomas F. O'Connell"
Дата:
Сообщение: Re: SELECT Generating Row Exclusive Locks?
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: How to run a stored PL/pgSQL function?