sql - How to find if a function exists in PostgreSQL and where? -
my question similar headline of question posted here answer there different , more complex need.
my problem simple... have function name func1
, know if , function implemented. it's location, it's arguments , it's code. i've tried build 1 using pg_proc
:
select proname,prosrc pg_proc proname 'func1';
how add schema name, function code (text) , , function argument list?
another issue curious me... can make work if instead of func1
i'll search lower
? lower build in function not implemented user.
the question not address whole problem. doesn't explain how in schema function defined nor if work on functions build in sql standard lower(string).
everything there in pg_proc
table.
the source code function in prosrc
field. pronamespace
field schema identifier (if want name, need join pg_namespace
table).
reconstructing parameter list information in pg_proc
not @ straightforward, select pg_get_function_arguments(oid) pg_proc
you. there a few related functions might find useful.
yes, lower()
in pg_proc
, built-in functions (though few, cast()
, coalesce()
, part of grammar). tiny fraction written in sql; most, prosrc
field gives name of function in underlying c code.
Comments
Post a Comment