summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/tupdesc.h9
-rw-r--r--src/include/commands/trigger.h10
-rw-r--r--src/include/lib/hasht.h4
-rw-r--r--src/include/utils/rel.h52
-rw-r--r--src/include/utils/relcache.h6
5 files changed, 50 insertions, 31 deletions
diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h
index 727fee212a..525cd6267e 100644
--- a/src/include/access/tupdesc.h
+++ b/src/include/access/tupdesc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: tupdesc.h,v 1.26 2000/01/26 05:57:51 momjian Exp $
+ * $Id: tupdesc.h,v 1.27 2000/01/31 04:35:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -47,12 +47,11 @@ typedef struct tupleConstr
*/
typedef struct tupleDesc
{
- int natts;
- /* Number of attributes in the tuple */
+ int natts; /* Number of attributes in the tuple */
Form_pg_attribute *attrs;
/* attrs[N] is a pointer to the description of Attribute Number N+1. */
TupleConstr *constr;
-} *TupleDesc;
+} *TupleDesc;
extern TupleDesc CreateTemplateTupleDesc(int natts);
@@ -64,6 +63,8 @@ extern TupleDesc CreateTupleDescCopyConstr(TupleDesc tupdesc);
extern void FreeTupleDesc(TupleDesc tupdesc);
+extern bool equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
+
extern bool TupleDescInitEntry(TupleDesc desc,
AttrNumber attributeNumber,
char *attributeName,
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index ddb9f7ca5b..b2c258c2f8 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -3,6 +3,10 @@
* trigger.h
* prototypes for trigger.c.
*
+ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: trigger.h,v 1.18 2000/01/31 04:35:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -70,6 +74,12 @@ extern void CreateTrigger(CreateTrigStmt *stmt);
extern void DropTrigger(DropTrigStmt *stmt);
extern void RelationRemoveTriggers(Relation rel);
+extern void RelationBuildTriggers(Relation relation);
+
+extern void FreeTriggerDesc(TriggerDesc *trigdesc);
+
+extern bool equalTriggerDescs(TriggerDesc *trigdesc1, TriggerDesc *trigdesc2);
+
extern HeapTuple ExecBRInsertTriggers(Relation rel, HeapTuple tuple);
extern void ExecARInsertTriggers(Relation rel, HeapTuple tuple);
extern bool ExecBRDeleteTriggers(EState *estate, ItemPointer tupleid);
diff --git a/src/include/lib/hasht.h b/src/include/lib/hasht.h
index 6f64022e23..78318f954d 100644
--- a/src/include/lib/hasht.h
+++ b/src/include/lib/hasht.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: hasht.h,v 1.9 2000/01/26 05:58:09 momjian Exp $
+ * $Id: hasht.h,v 1.10 2000/01/31 04:35:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -17,7 +17,7 @@
#include "utils/hsearch.h"
-typedef void (*HashtFunc) ();
+typedef void (*HashtFunc) (void *hashitem, int arg);
extern void HashTableWalk(HTAB *hashtable, HashtFunc function, int arg);
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index 867ffa604d..c823800802 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -1,13 +1,13 @@
/*-------------------------------------------------------------------------
*
* rel.h
- * POSTGRES relation descriptor definitions.
+ * POSTGRES relation descriptor (a/k/a relcache entry) definitions.
*
*
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: rel.h,v 1.33 2000/01/26 05:58:38 momjian Exp $
+ * $Id: rel.h,v 1.34 2000/01/31 04:35:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -21,6 +21,9 @@
#include "rewrite/prs2lock.h"
#include "storage/fd.h"
+/* added to prevent circular dependency. bjm 1999/11/15 */
+extern char *get_temp_rel_by_physicalname(const char *relname);
+
/*
* LockRelId and LockInfo really belong to lmgr.h, but it's more convenient
* to declare them here so we can have a LockInfoData field in a Relation.
@@ -39,6 +42,10 @@ typedef struct LockInfoData
typedef LockInfoData *LockInfo;
+/*
+ * Likewise, this struct really belongs to trigger.h, but for convenience
+ * we put it here.
+ */
typedef struct Trigger
{
@@ -58,6 +65,7 @@ typedef struct Trigger
typedef struct TriggerDesc
{
+ /* index data to identify which triggers are which */
uint16 n_before_statement[4];
uint16 n_before_row[4];
uint16 n_after_row[4];
@@ -66,9 +74,14 @@ typedef struct TriggerDesc
Trigger **tg_before_row[4];
Trigger **tg_after_row[4];
Trigger **tg_after_statement[4];
+ /* the actual array of triggers is here */
Trigger *triggers;
+ int numtriggers;
} TriggerDesc;
+/*
+ * Here are the contents of a relation cache entry.
+ */
typedef struct RelationData
{
@@ -87,7 +100,7 @@ typedef struct RelationData
RuleLock *rd_rules; /* rewrite rules */
IndexStrategy rd_istrat;
RegProcedure *rd_support;
- TriggerDesc *trigdesc;
+ TriggerDesc *trigdesc; /* Trigger info, or NULL if rel has none */
} RelationData;
typedef RelationData *Relation;
@@ -111,15 +124,6 @@ typedef Relation *RelationPtr;
#define InvalidRelation ((Relation) NULL)
/*
- * RelationGetSystemPort
- * Returns system port of a relation.
- *
- * Note:
- * Assumes relation descriptor is valid.
- */
-#define RelationGetSystemPort(relation) ((relation)->rd_fd)
-
-/*
* RelationHasReferenceCountZero
* True iff relation reference count is zero.
*
@@ -149,7 +153,7 @@ typedef Relation *RelationPtr;
/*
* RelationGetForm
- * Returns relation attribute values for a relation.
+ * Returns pg_class tuple for a relation.
*
* Note:
* Assumes relation descriptor is valid.
@@ -159,15 +163,14 @@ typedef Relation *RelationPtr;
/*
* RelationGetRelid
*
- * returns the object id of the relation
- *
+ * returns the OID of the relation
*/
#define RelationGetRelid(relation) ((relation)->rd_id)
/*
* RelationGetFile
*
- * Returns the open File decscriptor
+ * Returns the open file descriptor for the rel
*/
#define RelationGetFile(relation) ((relation)->rd_fd)
@@ -176,8 +179,6 @@ typedef Relation *RelationPtr;
*
* Returns a Relation Name
*/
-/* added to prevent circular dependency. bjm 1999/11/15 */
-char *get_temp_rel_by_physicalname(const char *relname);
#define RelationGetRelationName(relation) \
(\
(strncmp(RelationGetPhysicalRelationName(relation), \
@@ -210,10 +211,19 @@ char *get_temp_rel_by_physicalname(const char *relname);
*/
#define RelationGetDescr(relation) ((relation)->rd_att)
+/*
+ * RelationGetIndexStrategy
+ * Returns index strategy for a relation.
+ *
+ * Note:
+ * Assumes relation descriptor is valid.
+ * Assumes relation descriptor is for an index relation.
+ */
+#define RelationGetIndexStrategy(relation) ((relation)->rd_istrat)
-extern IndexStrategy RelationGetIndexStrategy(Relation relation);
-extern void RelationSetIndexSupport(Relation relation, IndexStrategy strategy,
- RegProcedure *support);
+extern void RelationSetIndexSupport(Relation relation,
+ IndexStrategy strategy,
+ RegProcedure *support);
#endif /* REL_H */
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index cb14e1b6d3..073c846e4b 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: relcache.h,v 1.18 2000/01/26 05:58:38 momjian Exp $
+ * $Id: relcache.h,v 1.19 2000/01/31 04:35:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -29,11 +29,9 @@ extern void RelationForgetRelation(Oid rid);
/*
* Routines for flushing/rebuilding relcache entries in various scenarios
*/
-extern void RelationRebuildRelation(Relation relation);
-
extern void RelationIdInvalidateRelationCacheByRelationId(Oid relationId);
-extern void RelationCacheInvalidate(bool onlyFlushReferenceCountZero);
+extern void RelationCacheInvalidate(void);
extern void RelationRegisterRelation(Relation relation);
extern void RelationPurgeLocalRelation(bool xactComitted);