]> granicus.if.org Git - postgresql/blob - src/include/utils/lsyscache.h
Clean up loose ends remaining from schema privileges discussion.
[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.51 2002/04/30 01:26: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 char op_volatile(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 char *get_func_name(Oid funcid);
41 extern Oid      get_func_rettype(Oid funcid);
42 extern char func_volatile(Oid funcid);
43 extern Oid      get_relname_relid(const char *relname, Oid relnamespace);
44 extern char *get_rel_name(Oid relid);
45 extern Oid      get_rel_namespace(Oid relid);
46 extern Oid      get_rel_type_id(Oid relid);
47 extern bool get_typisdefined(Oid typid);
48 extern int16 get_typlen(Oid typid);
49 extern bool get_typbyval(Oid typid);
50 extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
51 extern char get_typstorage(Oid typid);
52 extern Node *get_typdefault(Oid typid);
53 extern Oid getBaseType(Oid typid);
54 extern int32 get_typavgwidth(Oid typid, int32 typmod);
55 extern int32 get_attavgwidth(Oid relid, AttrNumber attnum);
56 extern bool get_attstatsslot(HeapTuple statstuple,
57                                  Oid atttype, int32 atttypmod,
58                                  int reqkind, Oid reqop,
59                                  Datum **values, int *nvalues,
60                                  float4 **numbers, int *nnumbers);
61 extern void free_attstatsslot(Oid atttype,
62                                   Datum *values, int nvalues,
63                                   float4 *numbers, int nnumbers);
64 extern char *get_namespace_name(Oid nspid);
65 extern int32 get_usesysid(const char *username);
66
67 #define TypeIsToastable(typid)  (get_typstorage(typid) != 'p')
68
69 #endif   /* LSYSCACHE_H */