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.31 2001/05/07 00:43:26 tgl Exp $
11 *-------------------------------------------------------------------------
16 #include "access/htup.h"
18 extern bool op_class(Oid opno, Oid opclass, Oid amopid);
19 extern char *get_attname(Oid relid, AttrNumber attnum);
20 extern AttrNumber get_attnum(Oid relid, char *attname);
21 extern Oid get_atttype(Oid relid, AttrNumber attnum);
22 extern bool get_attisset(Oid relid, char *attname);
23 extern int32 get_atttypmod(Oid relid, AttrNumber attnum);
24 extern RegProcedure get_opcode(Oid opno);
25 extern char *get_opname(Oid opno);
26 extern bool op_mergejoinable(Oid opno, Oid ltype, Oid rtype,
27 Oid *leftOp, Oid *rightOp);
28 extern Oid op_hashjoinable(Oid opno, Oid ltype, Oid rtype);
29 extern bool op_iscachable(Oid opno);
30 extern Oid get_commutator(Oid opno);
31 extern Oid get_negator(Oid opno);
32 extern RegProcedure get_oprrest(Oid opno);
33 extern RegProcedure get_oprjoin(Oid opno);
34 extern Oid get_func_rettype(Oid funcid);
35 extern bool func_iscachable(Oid funcid);
36 extern char *get_rel_name(Oid relid);
37 extern int16 get_typlen(Oid typid);
38 extern bool get_typbyval(Oid typid);
39 extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
40 extern char get_typstorage(Oid typid);
41 extern Datum get_typdefault(Oid typid);
42 extern bool get_attstatsslot(HeapTuple statstuple,
43 Oid atttype, int32 atttypmod,
44 int reqkind, Oid reqop,
45 Datum **values, int *nvalues,
46 float4 **numbers, int *nnumbers);
47 extern void free_attstatsslot(Oid atttype,
48 Datum *values, int nvalues,
49 float4 *numbers, int nnumbers);
51 #define TypeIsToastable(typid) (get_typstorage(typid) != 'p')
53 #endif /* LSYSCACHE_H */