Index: src/backend/utils/fmgr/funcapi.c =================================================================== RCS file: /opt/src/cvs/pgsql/src/backend/utils/fmgr/funcapi.c,v retrieving revision 1.2 diff -c -r1.2 funcapi.c *** src/backend/utils/fmgr/funcapi.c 18 Jul 2002 04:40:30 -0000 1.2 --- src/backend/utils/fmgr/funcapi.c 21 Jul 2002 01:04:51 -0000 *************** *** 10,15 **** --- 10,16 ---- */ #include "funcapi.h" + #include "catalog/pg_proc.h" #include "catalog/pg_type.h" #include "utils/syscache.h" *************** *** 136,139 **** --- 137,168 ---- *attelem = typtup->typelem; ReleaseSysCache(typeTuple); + } + + /* + * get the typeid for a function given the function Oid + */ + Oid + foidGetTypeId(Oid foid) + { + HeapTuple procedureTuple; + Form_pg_proc procedureStruct; + Oid functypeid; + + /* get the procedure tuple corresponding to the given function Oid */ + procedureTuple = SearchSysCache(PROCOID, + ObjectIdGetDatum(foid), + 0, 0, 0); + if (!HeapTupleIsValid(procedureTuple)) + elog(ERROR, "foidGetTypeId: Cache lookup failed for procedure %u", + foid); + + procedureStruct = (Form_pg_proc) GETSTRUCT(procedureTuple); + + functypeid = procedureStruct->prorettype; + + /* clean up */ + ReleaseSysCache(procedureTuple); + + return functypeid; } Index: src/backend/utils/misc/guc.c =================================================================== RCS file: /opt/src/cvs/pgsql/src/backend/utils/misc/guc.c,v retrieving revision 1.75 diff -c -r1.75 guc.c *** src/backend/utils/misc/guc.c 20 Jul 2002 15:12:55 -0000 1.75 --- src/backend/utils/misc/guc.c 21 Jul 2002 01:36:12 -0000 *************** *** 2347,2358 **** * form of name. Return value is palloc'd. */ char * ! GetConfigOptionByNum(int varnum, const char **varname) { ! struct config_generic *conf = guc_variables[varnum]; if (varname) *varname = conf->name; return _ShowOption(conf); } --- 2347,2366 ---- * form of name. Return value is palloc'd. */ char * ! GetConfigOptionByNum(int varnum, const char **varname, bool *noshow) { ! struct config_generic *conf; ! ! /* check requested variable number valid */ ! Assert((varnum >= 0) && (varnum < num_guc_variables)); ! ! conf = guc_variables[varnum]; if (varname) *varname = conf->name; + + if (noshow) + *noshow = (conf->flags & GUC_NO_SHOW_ALL) ? true : false; return _ShowOption(conf); } Index: src/include/funcapi.h =================================================================== RCS file: /opt/src/cvs/pgsql/src/include/funcapi.h,v retrieving revision 1.3 diff -c -r1.3 funcapi.h *** src/include/funcapi.h 18 Jul 2002 04:40:30 -0000 1.3 --- src/include/funcapi.h 21 Jul 2002 01:02:26 -0000 *************** *** 139,144 **** --- 139,149 ---- * HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values) - * build a HeapTuple given user data in C string form. values is an array * of C strings, one for each attribute of the return tuple. + * void get_type_metadata(Oid typeid, Oid *attinfuncid, Oid *attelem) - Get + * an attribute "in" function and typelem value given the typeid. + * Oid foidGetTypeId(Oid foid) - Get a function's typeid given the function + * Oid. Use this together with TypeGetTupleDesc() to get a TupleDesc + * which is derived from the function's declared return type. * * Macro declarations: * TupleGetDatum(TupleTableSlot *slot, HeapTuple tuple) - get a Datum *************** *** 156,161 **** --- 161,167 ---- /* from funcapi.c */ extern void get_type_metadata(Oid typeid, Oid *attinfuncid, Oid *attelem); + extern Oid foidGetTypeId(Oid foid); #define TupleGetDatum(_slot, _tuple) \ PointerGetDatum(ExecStoreTuple(_tuple, _slot, InvalidBuffer, true)) Index: src/include/utils/guc.h =================================================================== RCS file: /opt/src/cvs/pgsql/src/include/utils/guc.h,v retrieving revision 1.19 diff -c -r1.19 guc.h *** src/include/utils/guc.h 20 Jul 2002 15:12:56 -0000 1.19 --- src/include/utils/guc.h 20 Jul 2002 23:44:52 -0000 *************** *** 87,93 **** extern void ShowGUCConfigOption(const char *name); extern void ShowAllGUCConfig(void); extern char *GetConfigOptionByName(const char *name, const char **varname); ! extern char *GetConfigOptionByNum(int varnum, const char **varname); extern int GetNumConfigOptions(void); extern void SetPGVariable(const char *name, List *args, bool is_local); --- 87,93 ---- extern void ShowGUCConfigOption(const char *name); extern void ShowAllGUCConfig(void); extern char *GetConfigOptionByName(const char *name, const char **varname); ! extern char *GetConfigOptionByNum(int varnum, const char **varname, bool *noshow); extern int GetNumConfigOptions(void); extern void SetPGVariable(const char *name, List *args, bool is_local);