1 /*-------------------------------------------------------------------------
4 * Convenience routines for common queries in the system catalog cache.
6 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * $Id: lsyscache.h,v 1.37 2001/10/25 05:50:10 momjian Exp $
11 *-------------------------------------------------------------------------
16 #include "access/htup.h"
18 extern bool op_in_opclass(Oid opno, Oid opclass);
19 extern bool op_requires_recheck(Oid opno, Oid opclass);
20 extern char *get_attname(Oid relid, AttrNumber attnum);
21 extern AttrNumber get_attnum(Oid relid, char *attname);
22 extern Oid get_atttype(Oid relid, AttrNumber attnum);
23 extern bool get_attisset(Oid relid, char *attname);
24 extern int32 get_atttypmod(Oid relid, AttrNumber attnum);
25 extern void get_atttypetypmod(Oid relid, AttrNumber attnum,
26 Oid *typid, int32 *typmod);
27 extern bool opclass_is_btree(Oid opclass);
28 extern RegProcedure get_opcode(Oid opno);
29 extern char *get_opname(Oid opno);
30 extern bool op_mergejoinable(Oid opno, Oid ltype, Oid rtype,
31 Oid *leftOp, Oid *rightOp);
32 extern Oid op_hashjoinable(Oid opno, Oid ltype, Oid rtype);
33 extern bool op_iscachable(Oid opno);
34 extern Oid get_commutator(Oid opno);
35 extern Oid get_negator(Oid opno);
36 extern RegProcedure get_oprrest(Oid opno);
37 extern RegProcedure get_oprjoin(Oid opno);
38 extern Oid get_func_rettype(Oid funcid);
39 extern bool func_iscachable(Oid funcid);
40 extern char *get_rel_name(Oid relid);
41 extern int16 get_typlen(Oid typid);
42 extern bool get_typbyval(Oid typid);
43 extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
44 extern char get_typstorage(Oid typid);
45 extern bool get_typdefault(Oid typid, Datum *defaultValue);
46 extern int32 get_typavgwidth(Oid typid, int32 typmod);
47 extern int32 get_attavgwidth(Oid relid, AttrNumber attnum);
48 extern bool get_attstatsslot(HeapTuple statstuple,
49 Oid atttype, int32 atttypmod,
50 int reqkind, Oid reqop,
51 Datum **values, int *nvalues,
52 float4 **numbers, int *nnumbers);
53 extern void free_attstatsslot(Oid atttype,
54 Datum *values, int nvalues,
55 float4 *numbers, int nnumbers);
56 extern int32 get_usesysid(const char *username);
58 #define TypeIsToastable(typid) (get_typstorage(typid) != 'p')
59 #endif /* LSYSCACHE_H */