1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* lsyscache.h
|
1999-08-09 05:13:31 +02:00
|
|
|
* Convenience routines for common queries in the system catalog cache.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2007-01-05 23:20:05 +01:00
|
|
|
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2007-06-07 01:00:50 +02:00
|
|
|
* $PostgreSQL: pgsql/src/include/utils/lsyscache.h,v 1.119 2007/06/06 23:00:47 tgl Exp $
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef LSYSCACHE_H
|
|
|
|
#define LSYSCACHE_H
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2006-07-13 19:47:02 +02:00
|
|
|
#include "access/attnum.h"
|
1999-07-16 01:04:24 +02:00
|
|
|
#include "access/htup.h"
|
2006-07-13 19:47:02 +02:00
|
|
|
#include "nodes/pg_list.h"
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2003-06-27 02:33:26 +02:00
|
|
|
/* I/O function selector for get_type_io_data */
|
|
|
|
typedef enum IOFuncSelector
|
|
|
|
{
|
|
|
|
IOFunc_input,
|
|
|
|
IOFunc_output,
|
|
|
|
IOFunc_receive,
|
|
|
|
IOFunc_send
|
2003-08-08 23:42:59 +02:00
|
|
|
} IOFuncSelector;
|
2003-06-27 02:33:26 +02:00
|
|
|
|
2006-12-23 01:43:13 +01:00
|
|
|
extern bool op_in_opfamily(Oid opno, Oid opfamily);
|
|
|
|
extern int get_op_opfamily_strategy(Oid opno, Oid opfamily);
|
|
|
|
extern void get_op_opfamily_properties(Oid opno, Oid opfamily,
|
|
|
|
int *strategy,
|
|
|
|
Oid *lefttype,
|
|
|
|
Oid *righttype,
|
2004-08-29 07:07:03 +02:00
|
|
|
bool *recheck);
|
2006-12-23 01:43:13 +01:00
|
|
|
extern Oid get_opfamily_member(Oid opfamily, Oid lefttype, Oid righttype,
|
|
|
|
int16 strategy);
|
2007-01-21 01:57:15 +01:00
|
|
|
extern bool get_ordering_op_properties(Oid opno,
|
|
|
|
Oid *opfamily, Oid *opcintype, int16 *strategy);
|
2007-01-10 19:06:05 +01:00
|
|
|
extern bool get_compare_function_for_ordering_op(Oid opno,
|
|
|
|
Oid *cmpfunc, bool *reverse);
|
|
|
|
extern Oid get_equality_op_for_ordering_op(Oid opno);
|
|
|
|
extern Oid get_ordering_op_for_equality_op(Oid opno, bool use_lhs_type);
|
2007-01-20 21:45:41 +01:00
|
|
|
extern List *get_mergejoin_opfamilies(Oid opno);
|
2007-01-30 02:33:36 +01:00
|
|
|
extern bool get_compatible_hash_operators(Oid opno,
|
|
|
|
Oid *lhs_opno, Oid *rhs_opno);
|
|
|
|
extern bool get_op_hash_functions(Oid opno,
|
|
|
|
RegProcedure *lhs_procno, RegProcedure *rhs_procno);
|
2005-12-28 02:30:02 +01:00
|
|
|
extern void get_op_btree_interpretation(Oid opno,
|
2006-12-23 01:43:13 +01:00
|
|
|
List **opfamilies, List **opstrats);
|
2007-01-10 19:06:05 +01:00
|
|
|
extern bool ops_in_same_btree_opfamily(Oid opno1, Oid opno2);
|
2006-12-23 01:43:13 +01:00
|
|
|
extern Oid get_opfamily_proc(Oid opfamily, Oid lefttype, Oid righttype,
|
|
|
|
int16 procnum);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern char *get_attname(Oid relid, AttrNumber attnum);
|
2003-08-12 01:04:50 +02:00
|
|
|
extern char *get_relid_attribute_name(Oid relid, AttrNumber attnum);
|
2002-08-02 20:15:10 +02:00
|
|
|
extern AttrNumber get_attnum(Oid relid, const char *attname);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern Oid get_atttype(Oid relid, AttrNumber attnum);
|
1998-07-12 23:29:40 +02:00
|
|
|
extern int32 get_atttypmod(Oid relid, AttrNumber attnum);
|
2001-05-10 01:13:37 +02:00
|
|
|
extern void get_atttypetypmod(Oid relid, AttrNumber attnum,
|
2001-10-25 07:50:21 +02:00
|
|
|
Oid *typid, int32 *typmod);
|
2007-02-14 02:58:58 +01:00
|
|
|
extern char *get_constraint_name(Oid conoid);
|
2006-12-23 01:43:13 +01:00
|
|
|
extern Oid get_opclass_family(Oid opclass);
|
2005-12-28 02:30:02 +01:00
|
|
|
extern Oid get_opclass_input_type(Oid opclass);
|
2000-08-13 04:50:35 +02:00
|
|
|
extern RegProcedure get_opcode(Oid opno);
|
|
|
|
extern char *get_opname(Oid opno);
|
2003-12-03 18:45:10 +01:00
|
|
|
extern void op_input_types(Oid opno, Oid *lefttype, Oid *righttype);
|
2006-12-23 01:43:13 +01:00
|
|
|
extern bool op_mergejoinable(Oid opno);
|
2003-01-15 20:35:48 +01:00
|
|
|
extern bool op_hashjoinable(Oid opno);
|
2002-12-01 22:05:14 +01:00
|
|
|
extern bool op_strict(Oid opno);
|
2002-04-05 02:31:36 +02:00
|
|
|
extern char op_volatile(Oid opno);
|
2000-08-13 04:50:35 +02:00
|
|
|
extern Oid get_commutator(Oid opno);
|
|
|
|
extern Oid get_negator(Oid opno);
|
|
|
|
extern RegProcedure get_oprrest(Oid opno);
|
|
|
|
extern RegProcedure get_oprjoin(Oid opno);
|
2002-04-27 05:45:03 +02:00
|
|
|
extern char *get_func_name(Oid funcid);
|
1999-08-16 04:06:25 +02:00
|
|
|
extern Oid get_func_rettype(Oid funcid);
|
2005-03-29 02:17:27 +02:00
|
|
|
extern int get_func_nargs(Oid funcid);
|
|
|
|
extern Oid get_func_signature(Oid funcid, Oid **argtypes, int *nargs);
|
2002-09-04 22:31:48 +02:00
|
|
|
extern bool get_func_retset(Oid funcid);
|
2002-12-01 22:05:14 +01:00
|
|
|
extern bool func_strict(Oid funcid);
|
2002-04-05 02:31:36 +02:00
|
|
|
extern char func_volatile(Oid funcid);
|
2007-01-22 02:35:23 +01:00
|
|
|
extern float4 get_func_cost(Oid funcid);
|
|
|
|
extern float4 get_func_rows(Oid funcid);
|
2002-03-26 20:17:02 +01:00
|
|
|
extern Oid get_relname_relid(const char *relname, Oid relnamespace);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern char *get_rel_name(Oid relid);
|
2002-04-30 03:26:26 +02:00
|
|
|
extern Oid get_rel_namespace(Oid relid);
|
2002-03-22 03:56:37 +01:00
|
|
|
extern Oid get_rel_type_id(Oid relid);
|
2002-09-20 01:40:56 +02:00
|
|
|
extern char get_rel_relkind(Oid relid);
|
2002-03-29 20:06:29 +01:00
|
|
|
extern bool get_typisdefined(Oid typid);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern int16 get_typlen(Oid typid);
|
|
|
|
extern bool get_typbyval(Oid typid);
|
2000-11-16 23:30:52 +01:00
|
|
|
extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
|
2002-08-26 19:54:02 +02:00
|
|
|
extern void get_typlenbyvalalign(Oid typid, int16 *typlen, bool *typbyval,
|
2002-09-04 22:31:48 +02:00
|
|
|
char *typalign);
|
2004-06-06 02:41:28 +02:00
|
|
|
extern Oid getTypeIOParam(HeapTuple typeTuple);
|
2003-06-27 02:33:26 +02:00
|
|
|
extern void get_type_io_data(Oid typid,
|
2003-08-04 02:43:34 +02:00
|
|
|
IOFuncSelector which_func,
|
|
|
|
int16 *typlen,
|
|
|
|
bool *typbyval,
|
|
|
|
char *typalign,
|
|
|
|
char *typdelim,
|
2004-06-06 02:41:28 +02:00
|
|
|
Oid *typioparam,
|
2003-08-04 02:43:34 +02:00
|
|
|
Oid *func);
|
2000-11-20 21:36:57 +01:00
|
|
|
extern char get_typstorage(Oid typid);
|
2002-03-20 20:45:13 +01:00
|
|
|
extern Node *get_typdefault(Oid typid);
|
2002-08-05 04:30:50 +02:00
|
|
|
extern char get_typtype(Oid typid);
|
2006-09-28 22:51:43 +02:00
|
|
|
extern bool type_is_rowtype(Oid typid);
|
2007-04-02 05:49:42 +02:00
|
|
|
extern bool type_is_enum(Oid typid);
|
2002-09-20 01:40:56 +02:00
|
|
|
extern Oid get_typ_typrelid(Oid typid);
|
2003-04-09 01:20:04 +02:00
|
|
|
extern Oid get_element_type(Oid typid);
|
|
|
|
extern Oid get_array_type(Oid typid);
|
2004-06-06 02:41:28 +02:00
|
|
|
extern void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam);
|
2005-05-01 20:56:19 +02:00
|
|
|
extern void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena);
|
2004-06-06 02:41:28 +02:00
|
|
|
extern void getTypeBinaryInputInfo(Oid type, Oid *typReceive, Oid *typIOParam);
|
2005-05-01 20:56:19 +02:00
|
|
|
extern void getTypeBinaryOutputInfo(Oid type, Oid *typSend, bool *typIsVarlena);
|
2006-12-30 22:21:56 +01:00
|
|
|
extern Oid get_typmodin(Oid typid);
|
2002-09-04 22:31:48 +02:00
|
|
|
extern Oid getBaseType(Oid typid);
|
2006-04-06 00:11:58 +02:00
|
|
|
extern Oid getBaseTypeAndTypmod(Oid typid, int32 *typmod);
|
2001-05-09 02:35:09 +02:00
|
|
|
extern int32 get_typavgwidth(Oid typid, int32 typmod);
|
|
|
|
extern int32 get_attavgwidth(Oid relid, AttrNumber attnum);
|
2001-05-07 02:43:27 +02:00
|
|
|
extern bool get_attstatsslot(HeapTuple statstuple,
|
2001-10-25 07:50:21 +02:00
|
|
|
Oid atttype, int32 atttypmod,
|
|
|
|
int reqkind, Oid reqop,
|
|
|
|
Datum **values, int *nvalues,
|
|
|
|
float4 **numbers, int *nnumbers);
|
2001-05-07 02:43:27 +02:00
|
|
|
extern void free_attstatsslot(Oid atttype,
|
2001-10-25 07:50:21 +02:00
|
|
|
Datum *values, int nvalues,
|
|
|
|
float4 *numbers, int nnumbers);
|
2002-04-02 03:03:07 +02:00
|
|
|
extern char *get_namespace_name(Oid nspid);
|
2005-10-15 04:49:52 +02:00
|
|
|
extern Oid get_roleid(const char *rolname);
|
|
|
|
extern Oid get_roleid_checked(const char *rolname);
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2007-06-07 01:00:50 +02:00
|
|
|
#define type_is_array(typid) (get_element_type(typid) != InvalidOid)
|
2003-04-09 01:20:04 +02:00
|
|
|
|
2001-03-22 05:01:46 +01:00
|
|
|
#define TypeIsToastable(typid) (get_typstorage(typid) != 'p')
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* LSYSCACHE_H */
|