Re: Function exists

Поиск
Список
Период
Сортировка
От Marko Kreen
Тема Re: Function exists
Дата
Msg-id 20010925205901.A1406@l-t.ee
обсуждение исходный текст
Ответ на Function exists  ("Mihai Gheorghiu" <tanethq@earthlink.net>)
Список pgsql-general
On Tue, Sep 25, 2001 at 02:20:23PM -0400, Mihai Gheorghiu wrote:
> I want to write a function that finds out whether a function already exists.
> Is that possible? How?

select * from pg_proc where proname = ??;

you can run psql with switch -E, then it shows intenal queries
it performs.  Eg., for \df - 'show functions' it does:

$ psql -E
marko=# \df
********* QUERY *********
SELECT format_type(p.prorettype, NULL) as "Result", p.proname as
"Function",
       oidvectortypes(p.proargtypes) as "Arguments"
FROM pg_proc p
WHERE p.prorettype <> 0 and (pronargs = 0 or
oidvectortypes(p.proargtypes) <> '')
ORDER BY "Function", "Result", "Arguments"
*************************

from there you can hack further.

--
marko


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

Предыдущее
От: "Mihai Gheorghiu"
Дата:
Сообщение: Function exists
Следующее
От: reina@nsi.edu (Tony Reina)
Дата:
Сообщение: Re: [HACKERS] not on .hackers