Обсуждение: OID for pg_get_functiondef

Поиск
Список
Период
Сортировка

OID for pg_get_functiondef

От
jtkells@verizon.net
Дата:
I've just started working on an 8.4 database and I have been asked to
extract all the functions source code stored in various databases and
schemas so they  can be put into a repository for the developers.  I'm
planning to use  pg_get_functiondef(OID) but I am having a hard time
finding the OID for functions.  I've looked into the
information_schema and the pg_catalog schemas and have found
information on functions but none of them seem to have the OID of the
function.  Can anyone please tell how to get the OID for a function
within a schema  and or if there is a better way.

Thanks

Re: OID for pg_get_functiondef

От
Raghavendra
Дата:
select oid,proname from pg_proc where proname='function-name';

Best Regards,
Raghavendra
EnterpriseDB Corporation



On Mon, May 2, 2011 at 10:22 PM, <jtkells@verizon.net> wrote:
I've just started working on an 8.4 database and I have been asked to
extract all the functions source code stored in various databases and
schemas so they  can be put into a repository for the developers.  I'm
planning to use  pg_get_functiondef(OID) but I am having a hard time
finding the OID for functions.  I've looked into the
information_schema and the pg_catalog schemas and have found
information on functions but none of them seem to have the OID of the
function.  Can anyone please tell how to get the OID for a function
within a schema  and or if there is a better way.

Thanks

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: OID for pg_get_functiondef

От
Thomas Kellerer
Дата:
jtkells@verizon.net wrote on 02.05.2011 18:52:
> I've just started working on an 8.4 database and I have been asked to
> extract all the functions source code stored in various databases and
> schemas so they  can be put into a repository for the developers.  I'm
> planning to use  pg_get_functiondef(OID) but I am having a hard time
> finding the OID for functions.  I've looked into the
> information_schema and the pg_catalog schemas and have found
> information on functions but none of them seem to have the OID of the
> function.  Can anyone please tell how to get the OID for a function
> within a schema  and or if there is a better way.
>
> Thanks
>

select pg_function_def(oid)
from pg_proc
where proname = 'your_function'


Re: OID for pg_get_functiondef

От
Raghavendra
Дата:

On Mon, May 2, 2011 at 10:53 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:
jtkells@verizon.net wrote on 02.05.2011 18:52:

I've just started working on an 8.4 database and I have been asked to
extract all the functions source code stored in various databases and
schemas so they  can be put into a repository for the developers.  I'm
planning to use  pg_get_functiondef(OID) but I am having a hard time
finding the OID for functions.  I've looked into the
information_schema and the pg_catalog schemas and have found
information on functions but none of them seem to have the OID of the
function.  Can anyone please tell how to get the OID for a function
within a schema  and or if there is a better way.

Thanks


select pg_function_def(oid)
from pg_proc
where proname = 'your_function'



Small correction..

select pg_get_functiondef(oid) from pg_proc where proname = 'your_function'

Best Regards,
Raghavendra
EnterpriseDB Corporation



 


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin