mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
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
This commit is contained in:
28
src/backend/utils/cache/lsyscache.c
vendored
28
src/backend/utils/cache/lsyscache.c
vendored
@ -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.
|
||||
@ -1298,6 +1298,32 @@ get_func_name(Oid funcid)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
|
Reference in New Issue
Block a user