lsyscache.h 2.2 KB
Newer Older
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
Bruce Momjian's avatar
Add:  
Bruce Momjian committed
7
 * Portions Copyright (c) 1994, Regents of the University of California
8
 *
9
 * $Id: lsyscache.h,v 1.33 2001/05/09 23:13:37 tgl Exp $
10 11 12
 *
 *-------------------------------------------------------------------------
 */
13 14
#ifndef LSYSCACHE_H
#define LSYSCACHE_H
15

16
#include "access/htup.h"
17

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 22
extern Oid	get_atttype(Oid relid, AttrNumber attnum);
extern bool get_attisset(Oid relid, char *attname);
23
extern int32 get_atttypmod(Oid relid, AttrNumber attnum);
24 25
extern void get_atttypetypmod(Oid relid, AttrNumber attnum,
							  Oid *typid, int32 *typmod);
26 27 28
extern RegProcedure get_opcode(Oid opno);
extern char *get_opname(Oid opno);
extern bool op_mergejoinable(Oid opno, Oid ltype, Oid rtype,
29
				 Oid *leftOp, Oid *rightOp);
30 31 32 33 34 35
extern Oid	op_hashjoinable(Oid opno, Oid ltype, Oid rtype);
extern bool op_iscachable(Oid opno);
extern Oid	get_commutator(Oid opno);
extern Oid	get_negator(Oid opno);
extern RegProcedure get_oprrest(Oid opno);
extern RegProcedure get_oprjoin(Oid opno);
36
extern Oid	get_func_rettype(Oid funcid);
37
extern bool func_iscachable(Oid funcid);
38 39 40
extern char *get_rel_name(Oid relid);
extern int16 get_typlen(Oid typid);
extern bool get_typbyval(Oid typid);
41
extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
42
extern char get_typstorage(Oid typid);
43
extern Datum get_typdefault(Oid typid);
44 45
extern int32 get_typavgwidth(Oid typid, int32 typmod);
extern int32 get_attavgwidth(Oid relid, AttrNumber attnum);
46 47 48 49 50 51 52 53
extern bool get_attstatsslot(HeapTuple statstuple,
							 Oid atttype, int32 atttypmod,
							 int reqkind, Oid reqop,
							 Datum **values, int *nvalues,
							 float4 **numbers, int *nnumbers);
extern void free_attstatsslot(Oid atttype,
							  Datum *values, int nvalues,
							  float4 *numbers, int nnumbers);
54

55
#define TypeIsToastable(typid)	(get_typstorage(typid) != 'p')
56

57
#endif	 /* LSYSCACHE_H */