Eneboo - Documentación para desarrolladores
src/libpq/include/utils/lsyscache.h
Ir a la documentación de este archivo.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * lsyscache.h
00004  *        Convenience routines for common queries in the system catalog cache.
00005  *
00006  * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
00007  * Portions Copyright (c) 1994, Regents of the University of California
00008  *
00009  * $PostgreSQL: pgsql/src/include/utils/lsyscache.h,v 1.101 2005/10/15 02:49:46 momjian Exp $
00010  *
00011  *-------------------------------------------------------------------------
00012  */
00013 #ifndef LSYSCACHE_H
00014 #define LSYSCACHE_H
00015 
00016 #include "access/htup.h"
00017 
00018 /* I/O function selector for get_type_io_data */
00019 typedef enum IOFuncSelector
00020 {
00021         IOFunc_input,
00022         IOFunc_output,
00023         IOFunc_receive,
00024         IOFunc_send
00025 } IOFuncSelector;
00026 
00027 extern bool op_in_opclass(Oid opno, Oid opclass);
00028 extern int      get_op_opclass_strategy(Oid opno, Oid opclass);
00029 extern void get_op_opclass_properties(Oid opno, Oid opclass,
00030                                                   int *strategy, Oid *subtype,
00031                                                   bool *recheck);
00032 extern Oid      get_opclass_member(Oid opclass, Oid subtype, int16 strategy);
00033 extern Oid      get_op_hash_function(Oid opno);
00034 extern Oid      get_opclass_proc(Oid opclass, Oid subtype, int16 procnum);
00035 extern char *get_attname(Oid relid, AttrNumber attnum);
00036 extern char *get_relid_attribute_name(Oid relid, AttrNumber attnum);
00037 extern AttrNumber get_attnum(Oid relid, const char *attname);
00038 extern Oid      get_atttype(Oid relid, AttrNumber attnum);
00039 extern int32 get_atttypmod(Oid relid, AttrNumber attnum);
00040 extern void get_atttypetypmod(Oid relid, AttrNumber attnum,
00041                                   Oid *typid, int32 *typmod);
00042 extern bool opclass_is_btree(Oid opclass);
00043 extern bool opclass_is_hash(Oid opclass);
00044 extern RegProcedure get_opcode(Oid opno);
00045 extern char *get_opname(Oid opno);
00046 extern void op_input_types(Oid opno, Oid *lefttype, Oid *righttype);
00047 extern bool op_mergejoinable(Oid opno, Oid *leftOp, Oid *rightOp);
00048 extern void op_mergejoin_crossops(Oid opno, Oid *ltop, Oid *gtop,
00049                                           RegProcedure *ltproc, RegProcedure *gtproc);
00050 extern bool op_hashjoinable(Oid opno);
00051 extern bool op_strict(Oid opno);
00052 extern char op_volatile(Oid opno);
00053 extern Oid      get_commutator(Oid opno);
00054 extern Oid      get_negator(Oid opno);
00055 extern RegProcedure get_oprrest(Oid opno);
00056 extern RegProcedure get_oprjoin(Oid opno);
00057 extern char *get_func_name(Oid funcid);
00058 extern Oid      get_func_rettype(Oid funcid);
00059 extern int      get_func_nargs(Oid funcid);
00060 extern Oid      get_func_signature(Oid funcid, Oid **argtypes, int *nargs);
00061 extern bool get_func_retset(Oid funcid);
00062 extern bool func_strict(Oid funcid);
00063 extern char func_volatile(Oid funcid);
00064 extern Oid      get_relname_relid(const char *relname, Oid relnamespace);
00065 extern char *get_rel_name(Oid relid);
00066 extern Oid      get_rel_namespace(Oid relid);
00067 extern Oid      get_rel_type_id(Oid relid);
00068 extern char get_rel_relkind(Oid relid);
00069 extern bool get_typisdefined(Oid typid);
00070 extern int16 get_typlen(Oid typid);
00071 extern bool get_typbyval(Oid typid);
00072 extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
00073 extern void get_typlenbyvalalign(Oid typid, int16 *typlen, bool *typbyval,
00074                                          char *typalign);
00075 extern Oid      getTypeIOParam(HeapTuple typeTuple);
00076 extern void get_type_io_data(Oid typid,
00077                                  IOFuncSelector which_func,
00078                                  int16 *typlen,
00079                                  bool *typbyval,
00080                                  char *typalign,
00081                                  char *typdelim,
00082                                  Oid *typioparam,
00083                                  Oid *func);
00084 extern char get_typstorage(Oid typid);
00085 extern int32 get_typtypmod(Oid typid);
00086 extern Node *get_typdefault(Oid typid);
00087 extern char get_typtype(Oid typid);
00088 extern Oid      get_typ_typrelid(Oid typid);
00089 extern Oid      get_element_type(Oid typid);
00090 extern Oid      get_array_type(Oid typid);
00091 extern void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam);
00092 extern void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena);
00093 extern void getTypeBinaryInputInfo(Oid type, Oid *typReceive, Oid *typIOParam);
00094 extern void getTypeBinaryOutputInfo(Oid type, Oid *typSend, bool *typIsVarlena);
00095 extern Oid      getBaseType(Oid typid);
00096 extern int32 get_typavgwidth(Oid typid, int32 typmod);
00097 extern int32 get_attavgwidth(Oid relid, AttrNumber attnum);
00098 extern bool get_attstatsslot(HeapTuple statstuple,
00099                                  Oid atttype, int32 atttypmod,
00100                                  int reqkind, Oid reqop,
00101                                  Datum **values, int *nvalues,
00102                                  float4 **numbers, int *nnumbers);
00103 extern void free_attstatsslot(Oid atttype,
00104                                   Datum *values, int nvalues,
00105                                   float4 *numbers, int nnumbers);
00106 extern char *get_namespace_name(Oid nspid);
00107 extern Oid      get_roleid(const char *rolname);
00108 extern Oid      get_roleid_checked(const char *rolname);
00109 
00110 #define is_array_type(typid)  (get_element_type(typid) != InvalidOid)
00111 
00112 #define TypeIsToastable(typid)  (get_typstorage(typid) != 'p')
00113 
00114 #endif   /* LSYSCACHE_H */
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'