mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-06 12:49:21 +02:00
pg_relcheck is gone; CHECK, UNIQUE, PRIMARY KEY, and FOREIGN KEY constraints all have real live entries in pg_constraint. pg_depend exists, and RESTRICT/CASCADE options work on most kinds of DROP; however, pg_depend is not yet very well populated with dependencies. (Most of the ones that are present at this point just replace formerly hardwired associations, such as the implicit drop of a relation's pg_type entry when the relation is dropped.) Need to add more logic to create dependency entries, improve pg_dump to dump constraints in place of indexes and triggers, and add some regression tests.
73 lines
2.9 KiB
C
73 lines
2.9 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* lsyscache.h
|
|
* Convenience routines for common queries in the system catalog cache.
|
|
*
|
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* $Id: lsyscache.h,v 1.55 2002/07/12 18:43:19 tgl Exp $
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef LSYSCACHE_H
|
|
#define LSYSCACHE_H
|
|
|
|
#include "access/htup.h"
|
|
|
|
extern bool op_in_opclass(Oid opno, Oid opclass);
|
|
extern bool op_requires_recheck(Oid opno, Oid opclass);
|
|
extern char *get_attname(Oid relid, AttrNumber attnum);
|
|
extern AttrNumber get_attnum(Oid relid, char *attname);
|
|
extern Oid get_atttype(Oid relid, AttrNumber attnum);
|
|
extern bool get_attisset(Oid relid, char *attname);
|
|
extern int32 get_atttypmod(Oid relid, AttrNumber attnum);
|
|
extern void get_atttypetypmod(Oid relid, AttrNumber attnum,
|
|
Oid *typid, int32 *typmod);
|
|
extern bool opclass_is_btree(Oid opclass);
|
|
extern RegProcedure get_opcode(Oid opno);
|
|
extern char *get_opname(Oid opno);
|
|
extern bool op_mergejoinable(Oid opno, Oid ltype, Oid rtype,
|
|
Oid *leftOp, Oid *rightOp);
|
|
extern void op_mergejoin_crossops(Oid opno, Oid *ltop, Oid *gtop,
|
|
RegProcedure *ltproc, RegProcedure *gtproc);
|
|
extern Oid op_hashjoinable(Oid opno, Oid ltype, Oid rtype);
|
|
extern char op_volatile(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);
|
|
extern char *get_func_name(Oid funcid);
|
|
extern Oid get_func_rettype(Oid funcid);
|
|
extern bool get_func_retset(Oid funcid);
|
|
extern char func_volatile(Oid funcid);
|
|
extern Oid get_relname_relid(const char *relname, Oid relnamespace);
|
|
extern Oid get_system_catalog_relid(const char *catname);
|
|
extern char *get_rel_name(Oid relid);
|
|
extern Oid get_rel_namespace(Oid relid);
|
|
extern Oid get_rel_type_id(Oid relid);
|
|
extern bool get_typisdefined(Oid typid);
|
|
extern int16 get_typlen(Oid typid);
|
|
extern bool get_typbyval(Oid typid);
|
|
extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
|
|
extern char get_typstorage(Oid typid);
|
|
extern Node *get_typdefault(Oid typid);
|
|
extern Oid getBaseType(Oid typid);
|
|
extern Oid getBaseTypeTypeMod(Oid typid, int32 *typmod);
|
|
extern int32 get_typavgwidth(Oid typid, int32 typmod);
|
|
extern int32 get_attavgwidth(Oid relid, AttrNumber attnum);
|
|
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);
|
|
extern char *get_namespace_name(Oid nspid);
|
|
extern int32 get_usesysid(const char *username);
|
|
|
|
#define TypeIsToastable(typid) (get_typstorage(typid) != 'p')
|
|
|
|
#endif /* LSYSCACHE_H */
|