]> granicus.if.org Git - postgresql/blob - src/include/utils/lsyscache.h
90130178ca183d5a6bc6290e9b9d21b5a8654348
[postgresql] / src / include / utils / lsyscache.h
1 /*-------------------------------------------------------------------------
2  *
3  * lsyscache.h
4  *        Convenience routines for common queries in the system catalog cache.
5  *
6  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: lsyscache.h,v 1.47 2002/03/29 19:06:26 tgl Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef LSYSCACHE_H
14 #define LSYSCACHE_H
15
16 #include "access/htup.h"
17
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 void op_mergejoin_crossops(Oid opno, Oid *ltop, Oid *gtop,
33                                  RegProcedure *ltproc, RegProcedure *gtproc);
34 extern Oid      op_hashjoinable(Oid opno, Oid ltype, Oid rtype);
35 extern bool op_iscachable(Oid opno);
36 extern Oid      get_commutator(Oid opno);
37 extern Oid      get_negator(Oid opno);
38 extern RegProcedure get_oprrest(Oid opno);
39 extern RegProcedure get_oprjoin(Oid opno);
40 extern Oid      get_func_rettype(Oid funcid);
41 extern bool func_iscachable(Oid funcid);
42 extern Oid      get_relname_relid(const char *relname, Oid relnamespace);
43 extern char *get_rel_name(Oid relid);
44 extern Oid      get_rel_type_id(Oid relid);
45 extern bool get_typisdefined(Oid typid);
46 extern int16 get_typlen(Oid typid);
47 extern bool get_typbyval(Oid typid);
48 extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
49 extern char get_typstorage(Oid typid);
50 extern Node *get_typdefault(Oid typid);
51 extern Oid getBaseType(Oid typid);
52 extern int32 get_typavgwidth(Oid typid, int32 typmod);
53 extern int32 get_attavgwidth(Oid relid, AttrNumber attnum);
54 extern bool get_attstatsslot(HeapTuple statstuple,
55                                  Oid atttype, int32 atttypmod,
56                                  int reqkind, Oid reqop,
57                                  Datum **values, int *nvalues,
58                                  float4 **numbers, int *nnumbers);
59 extern void free_attstatsslot(Oid atttype,
60                                   Datum *values, int nvalues,
61                                   float4 *numbers, int nnumbers);
62 extern int32 get_usesysid(const char *username);
63
64 #define TypeIsToastable(typid)  (get_typstorage(typid) != 'p')
65
66 #endif   /* LSYSCACHE_H */