1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* lsyscache.h
|
1999-08-09 05:13:31 +02:00
|
|
|
* Convenience routines for common queries in the system catalog cache.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2001-01-24 20:43:33 +01:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2002-03-26 20:17:02 +01:00
|
|
|
* $Id: lsyscache.h,v 1.46 2002/03/26 19:16:57 tgl Exp $
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef LSYSCACHE_H
|
|
|
|
#define LSYSCACHE_H
|
1996-08-28 03:59:28 +02:00
|
|
|
|
1999-07-16 01:04:24 +02:00
|
|
|
#include "access/htup.h"
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2001-08-21 18:36:06 +02:00
|
|
|
extern bool op_in_opclass(Oid opno, Oid opclass);
|
|
|
|
extern bool op_requires_recheck(Oid opno, Oid opclass);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern char *get_attname(Oid relid, AttrNumber attnum);
|
1996-08-28 03:59:28 +02:00
|
|
|
extern AttrNumber get_attnum(Oid relid, char *attname);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern Oid get_atttype(Oid relid, AttrNumber attnum);
|
|
|
|
extern bool get_attisset(Oid relid, char *attname);
|
1998-07-12 23:29:40 +02:00
|
|
|
extern int32 get_atttypmod(Oid relid, AttrNumber attnum);
|
2001-05-10 01:13:37 +02:00
|
|
|
extern void get_atttypetypmod(Oid relid, AttrNumber attnum,
|
2001-10-25 07:50:21 +02:00
|
|
|
Oid *typid, int32 *typmod);
|
2001-08-21 18:36:06 +02:00
|
|
|
extern bool opclass_is_btree(Oid opclass);
|
2000-08-13 04:50:35 +02:00
|
|
|
extern RegProcedure get_opcode(Oid opno);
|
|
|
|
extern char *get_opname(Oid opno);
|
|
|
|
extern bool op_mergejoinable(Oid opno, Oid ltype, Oid rtype,
|
1997-09-08 23:56:23 +02:00
|
|
|
Oid *leftOp, Oid *rightOp);
|
2002-03-01 05:09:28 +01:00
|
|
|
extern void op_mergejoin_crossops(Oid opno, Oid *ltop, Oid *gtop,
|
|
|
|
RegProcedure *ltproc, RegProcedure *gtproc);
|
2000-08-13 04:50:35 +02:00
|
|
|
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);
|
1999-08-16 04:06:25 +02:00
|
|
|
extern Oid get_func_rettype(Oid funcid);
|
2000-08-13 04:50:35 +02:00
|
|
|
extern bool func_iscachable(Oid funcid);
|
2002-03-26 20:17:02 +01:00
|
|
|
extern Oid get_relname_relid(const char *relname, Oid relnamespace);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern char *get_rel_name(Oid relid);
|
2002-03-22 03:56:37 +01:00
|
|
|
extern Oid get_rel_type_id(Oid relid);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern int16 get_typlen(Oid typid);
|
|
|
|
extern bool get_typbyval(Oid typid);
|
2000-11-16 23:30:52 +01:00
|
|
|
extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
|
2000-11-20 21:36:57 +01:00
|
|
|
extern char get_typstorage(Oid typid);
|
2002-03-20 20:45:13 +01:00
|
|
|
extern Node *get_typdefault(Oid typid);
|
|
|
|
extern Oid getBaseType(Oid typid);
|
2001-05-09 02:35:09 +02:00
|
|
|
extern int32 get_typavgwidth(Oid typid, int32 typmod);
|
|
|
|
extern int32 get_attavgwidth(Oid relid, AttrNumber attnum);
|
2001-05-07 02:43:27 +02:00
|
|
|
extern bool get_attstatsslot(HeapTuple statstuple,
|
2001-10-25 07:50:21 +02:00
|
|
|
Oid atttype, int32 atttypmod,
|
|
|
|
int reqkind, Oid reqop,
|
|
|
|
Datum **values, int *nvalues,
|
|
|
|
float4 **numbers, int *nnumbers);
|
2001-05-07 02:43:27 +02:00
|
|
|
extern void free_attstatsslot(Oid atttype,
|
2001-10-25 07:50:21 +02:00
|
|
|
Datum *values, int nvalues,
|
|
|
|
float4 *numbers, int nnumbers);
|
2001-06-14 03:09:22 +02:00
|
|
|
extern int32 get_usesysid(const char *username);
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2001-03-22 05:01:46 +01:00
|
|
|
#define TypeIsToastable(typid) (get_typstorage(typid) != 'p')
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* LSYSCACHE_H */
|