diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-08-10 05:46:50 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-08-10 05:46:50 +0000 |
commit | 9bd27b7c9e998087f390774bd0f43916813a2847 (patch) | |
tree | ee2b7fa2b2e77c53c87a53a786163dae1b0e6538 /src/backend/utils/cache/lsyscache.c | |
parent | 18894c401f1f5ec5af1d08a12da1f183599e8560 (diff) |
Extend EXPLAIN to support output in XML or JSON format.
There are probably still some adjustments to be made in the details
of the output, but this gets the basic structure in place.
Robert Haas
Diffstat (limited to 'src/backend/utils/cache/lsyscache.c')
-rw-r--r-- | src/backend/utils/cache/lsyscache.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 8247516bd14..0b50309bf36 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.162 2009/06/11 14:49:05 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.163 2009/08/10 05:46:50 tgl Exp $ * * NOTES * Eventually, the index information should go through here, too. @@ -1299,6 +1299,32 @@ get_func_name(Oid funcid) } /* + * get_func_namespace + * + * Returns the pg_namespace OID associated with a given function. + */ +Oid +get_func_namespace(Oid funcid) +{ + HeapTuple tp; + + tp = SearchSysCache(PROCOID, + ObjectIdGetDatum(funcid), + 0, 0, 0); + if (HeapTupleIsValid(tp)) + { + Form_pg_proc functup = (Form_pg_proc) GETSTRUCT(tp); + Oid result; + + result = functup->pronamespace; + ReleaseSysCache(tp); + return result; + } + else + return InvalidOid; +} + +/* * get_func_rettype * Given procedure id, return the function's result type. */ |