mirror of
https://github.com/postgres/postgres.git
synced 2025-08-09 17:03:00 +03:00
Move Trigger and TriggerDesc structs out of rel.h into a new reltrigger.h
This lets us stop including rel.h into execnodes.h, which is a widely used header.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "miscadmin.h"
|
||||
#include "storage/bufmgr.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
#define GIN_PAGE_FREESIZE \
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include "storage/smgr.h"
|
||||
#include "storage/indexfsm.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
typedef struct
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include "storage/bufmgr.h"
|
||||
#include "storage/indexfsm.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
/* Working state for gistbuild and its callback */
|
||||
typedef struct
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include "storage/bufmgr.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include "optimizer/cost.h"
|
||||
#include "optimizer/plancat.h"
|
||||
#include "storage/bufmgr.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
/* Working state for hashbuild and its callback */
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include "executor/execdebug.h"
|
||||
#include "storage/bufmgr.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "storage/lwlock.h"
|
||||
#include "storage/shmem.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
static bool _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op,
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#include "utils/fmgroids.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/ps_status.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/relmapper.h"
|
||||
#include "utils/tqual.h"
|
||||
|
||||
|
@@ -70,7 +70,7 @@
|
||||
#include "utils/fmgroids.h"
|
||||
#include "utils/inval.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/snapmgr.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/tqual.h"
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#include "catalog/index.h"
|
||||
#include "catalog/indexing.h"
|
||||
#include "executor/executor.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "utils/acl.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "miscadmin.h"
|
||||
#include "nodes/makefuncs.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
/* Potentially set by contrib/pg_upgrade_support functions */
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include "utils/acl.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#include "commands/trigger.h"
|
||||
#include "executor/executor.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/tqual.h"
|
||||
|
||||
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/snapmgr.h"
|
||||
|
||||
|
||||
|
@@ -32,8 +32,9 @@
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/guc.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/tuplesort.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/snapmgr.h"
|
||||
#include "utils/tuplesort.h"
|
||||
#include "utils/xml.h"
|
||||
|
||||
|
||||
|
@@ -51,6 +51,7 @@
|
||||
#include "utils/fmgroids.h"
|
||||
#include "utils/guc.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/snapmgr.h"
|
||||
#include "utils/tqual.h"
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "utils/acl.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
|
||||
|
@@ -51,6 +51,7 @@
|
||||
#include "utils/inval.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/snapmgr.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/tqual.h"
|
||||
|
@@ -63,6 +63,7 @@
|
||||
#include "utils/fmgroids.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/tqual.h"
|
||||
|
||||
|
@@ -48,6 +48,7 @@
|
||||
#include "executor/nodeWindowAgg.h"
|
||||
#include "executor/nodeWorktablescan.h"
|
||||
#include "nodes/nodeFuncs.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/portal.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
static char *fetch_cursor_param_value(ExprContext *econtext, int paramId);
|
||||
|
@@ -44,6 +44,7 @@
|
||||
#include "storage/bufmgr.h"
|
||||
#include "storage/predicate.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/snapmgr.h"
|
||||
#include "utils/tqual.h"
|
||||
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include "executor/executor.h"
|
||||
#include "executor/nodeForeignscan.h"
|
||||
#include "foreign/fdwapi.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
static TupleTableSlot *ForeignNext(ForeignScanState *node);
|
||||
static bool ForeignRecheck(ForeignScanState *node, TupleTableSlot *slot);
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "utils/array.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
static TupleTableSlot *IndexNext(IndexScanState *node);
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include "executor/executor.h"
|
||||
#include "executor/nodeLockRows.h"
|
||||
#include "storage/bufmgr.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/tqual.h"
|
||||
|
||||
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "executor/execdebug.h"
|
||||
#include "executor/nodeMergeAppend.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
/*
|
||||
* It gets quite confusing having a heap array (indexed by integers) which
|
||||
|
@@ -46,6 +46,7 @@
|
||||
#include "storage/bufmgr.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/tqual.h"
|
||||
|
||||
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "access/relscan.h"
|
||||
#include "executor/execdebug.h"
|
||||
#include "executor/nodeSeqscan.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
static void InitScanRelation(SeqScanState *node, EState *estate);
|
||||
static TupleTableSlot *SeqNext(SeqScanState *node);
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "optimizer/clauses.h"
|
||||
#include "storage/bufmgr.h"
|
||||
#include "utils/array.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
#define IsCTIDVar(node) \
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "utils/datum.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/snapmgr.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/typcache.h"
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include "parser/parse_oper.h"
|
||||
#include "parser/parsetree.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
#include "catalog/pg_am.h"
|
||||
#include "catalog/pg_amop.h"
|
||||
#include "catalog/pg_proc.h"
|
||||
#include "catalog/pg_type.h"
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "parser/parse_type.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "parser/parse_type.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/typcache.h"
|
||||
|
||||
|
||||
|
@@ -59,7 +59,7 @@
|
||||
#include "utils/acl.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/typcache.h"
|
||||
|
||||
|
@@ -93,6 +93,7 @@
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/ps_status.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/snapmgr.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/tqual.h"
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include "access/heapam.h"
|
||||
#include "access/sysattr.h"
|
||||
#include "catalog/pg_type.h"
|
||||
#include "commands/trigger.h"
|
||||
#include "nodes/makefuncs.h"
|
||||
#include "nodes/nodeFuncs.h"
|
||||
#include "parser/analyze.h"
|
||||
@@ -26,7 +27,7 @@
|
||||
#include "rewrite/rewriteManip.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "commands/trigger.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
/* We use a list of these to detect recursion in RewriteQuery */
|
||||
|
@@ -48,6 +48,7 @@
|
||||
#include "utils/guc.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/snapmgr.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/tqual.h"
|
||||
|
@@ -52,8 +52,9 @@
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/fmgroids.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "utils/typcache.h"
|
||||
#include "utils/xml.h"
|
||||
|
||||
|
@@ -120,6 +120,7 @@
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/nabstime.h"
|
||||
#include "utils/pg_locale.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/selfuncs.h"
|
||||
#include "utils/spccache.h"
|
||||
#include "utils/syscache.h"
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include "access/htup.h"
|
||||
#include "commands/trigger.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include "tsearch/ts_utils.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
typedef struct
|
||||
|
@@ -74,6 +74,7 @@
|
||||
#include "utils/datetime.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/xml.h"
|
||||
|
||||
|
1
src/backend/utils/cache/lsyscache.c
vendored
1
src/backend/utils/cache/lsyscache.c
vendored
@@ -35,6 +35,7 @@
|
||||
#include "utils/datum.h"
|
||||
#include "utils/fmgroids.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/typcache.h"
|
||||
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/typcache.h"
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#include "nodes/plannodes.h"
|
||||
#include "nodes/tidbitmap.h"
|
||||
#include "utils/hsearch.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/reltrigger.h"
|
||||
#include "utils/snapshot.h"
|
||||
#include "utils/tuplestore.h"
|
||||
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "storage/block.h"
|
||||
#include "storage/relfilenode.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/reltrigger.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -44,60 +45,6 @@ typedef struct LockInfoData
|
||||
|
||||
typedef LockInfoData *LockInfo;
|
||||
|
||||
/*
|
||||
* Likewise, this struct really belongs to trigger.h, but for convenience
|
||||
* we put it here.
|
||||
*/
|
||||
typedef struct Trigger
|
||||
{
|
||||
Oid tgoid; /* OID of trigger (pg_trigger row) */
|
||||
/* Remaining fields are copied from pg_trigger, see pg_trigger.h */
|
||||
char *tgname;
|
||||
Oid tgfoid;
|
||||
int16 tgtype;
|
||||
char tgenabled;
|
||||
bool tgisinternal;
|
||||
Oid tgconstrrelid;
|
||||
Oid tgconstrindid;
|
||||
Oid tgconstraint;
|
||||
bool tgdeferrable;
|
||||
bool tginitdeferred;
|
||||
int16 tgnargs;
|
||||
int16 tgnattr;
|
||||
int16 *tgattr;
|
||||
char **tgargs;
|
||||
char *tgqual;
|
||||
} Trigger;
|
||||
|
||||
typedef struct TriggerDesc
|
||||
{
|
||||
Trigger *triggers; /* array of Trigger structs */
|
||||
int numtriggers; /* number of array entries */
|
||||
|
||||
/*
|
||||
* These flags indicate whether the array contains at least one of each
|
||||
* type of trigger. We use these to skip searching the array if not.
|
||||
*/
|
||||
bool trig_insert_before_row;
|
||||
bool trig_insert_after_row;
|
||||
bool trig_insert_instead_row;
|
||||
bool trig_insert_before_statement;
|
||||
bool trig_insert_after_statement;
|
||||
bool trig_update_before_row;
|
||||
bool trig_update_after_row;
|
||||
bool trig_update_instead_row;
|
||||
bool trig_update_before_statement;
|
||||
bool trig_update_after_statement;
|
||||
bool trig_delete_before_row;
|
||||
bool trig_delete_after_row;
|
||||
bool trig_delete_instead_row;
|
||||
bool trig_delete_before_statement;
|
||||
bool trig_delete_after_statement;
|
||||
/* there are no row-level truncate triggers */
|
||||
bool trig_truncate_before_statement;
|
||||
bool trig_truncate_after_statement;
|
||||
} TriggerDesc;
|
||||
|
||||
|
||||
/*
|
||||
* Cached lookup information for the index access method functions defined
|
||||
|
74
src/include/utils/reltrigger.h
Normal file
74
src/include/utils/reltrigger.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* reltrigger.h
|
||||
* POSTGRES relation trigger definitions.
|
||||
*
|
||||
*
|
||||
* Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* src/include/utils/reltrigger.h
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef RELTRIGGER_H
|
||||
#define RELTRIGGER_H
|
||||
|
||||
|
||||
/*
|
||||
* These struct really belongs to trigger.h, but we put it separately so that
|
||||
* it can be cleanly included in rel.h and other places.
|
||||
*/
|
||||
|
||||
typedef struct Trigger
|
||||
{
|
||||
Oid tgoid; /* OID of trigger (pg_trigger row) */
|
||||
/* Remaining fields are copied from pg_trigger, see pg_trigger.h */
|
||||
char *tgname;
|
||||
Oid tgfoid;
|
||||
int16 tgtype;
|
||||
char tgenabled;
|
||||
bool tgisinternal;
|
||||
Oid tgconstrrelid;
|
||||
Oid tgconstrindid;
|
||||
Oid tgconstraint;
|
||||
bool tgdeferrable;
|
||||
bool tginitdeferred;
|
||||
int16 tgnargs;
|
||||
int16 tgnattr;
|
||||
int16 *tgattr;
|
||||
char **tgargs;
|
||||
char *tgqual;
|
||||
} Trigger;
|
||||
|
||||
typedef struct TriggerDesc
|
||||
{
|
||||
Trigger *triggers; /* array of Trigger structs */
|
||||
int numtriggers; /* number of array entries */
|
||||
|
||||
/*
|
||||
* These flags indicate whether the array contains at least one of each
|
||||
* type of trigger. We use these to skip searching the array if not.
|
||||
*/
|
||||
bool trig_insert_before_row;
|
||||
bool trig_insert_after_row;
|
||||
bool trig_insert_instead_row;
|
||||
bool trig_insert_before_statement;
|
||||
bool trig_insert_after_statement;
|
||||
bool trig_update_before_row;
|
||||
bool trig_update_after_row;
|
||||
bool trig_update_instead_row;
|
||||
bool trig_update_before_statement;
|
||||
bool trig_update_after_statement;
|
||||
bool trig_delete_before_row;
|
||||
bool trig_delete_after_row;
|
||||
bool trig_delete_instead_row;
|
||||
bool trig_delete_before_statement;
|
||||
bool trig_delete_after_statement;
|
||||
/* there are no row-level truncate triggers */
|
||||
bool trig_truncate_before_statement;
|
||||
bool trig_truncate_after_statement;
|
||||
} TriggerDesc;
|
||||
|
||||
|
||||
#endif /* RELTRIGGER_H */
|
@@ -34,6 +34,7 @@
|
||||
#include "utils/hsearch.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/typcache.h"
|
||||
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "utils/datum.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/snapmgr.h"
|
||||
#include "utils/typcache.h"
|
||||
|
||||
|
@@ -108,6 +108,7 @@ typedef int Py_ssize_t;
|
||||
#include "utils/hsearch.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/typcache.h"
|
||||
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/typcache.h"
|
||||
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include "executor/spi.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/geo_decls.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
#define P_MAXDIG 12
|
||||
|
Reference in New Issue
Block a user