I want to write a function that finds out whether a function already exists. Is that possible? How? Thank you all.
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
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера