diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-07-29 20:56:21 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-07-29 20:56:21 +0000 |
| commit | 25d9bf2e3e66ee2e546c5c523d148ecab6ee1dcc (patch) | |
| tree | b0dee0f1d6111fd6658d432ec30e5ddb88adc02f /src/include/commands | |
| parent | 850490579318ff52097eec92ce535357dd0c7a3a (diff) | |
| download | postgresql-25d9bf2e3e66ee2e546c5c523d148ecab6ee1dcc.tar.gz | |
Support deferrable uniqueness constraints.
The current implementation fires an AFTER ROW trigger for each tuple that
looks like it might be non-unique according to the index contents at the
time of insertion. This works well as long as there aren't many conflicts,
but won't scale to massive unique-key reassignments. Improving that case
is a TODO item.
Dean Rasheed
Diffstat (limited to 'src/include/commands')
| -rw-r--r-- | src/include/commands/defrem.h | 4 | ||||
| -rw-r--r-- | src/include/commands/trigger.h | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index 1d6ab7bbf4..4396a49738 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.95 2009/07/16 06:33:45 petere Exp $ + * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.96 2009/07/29 20:56:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -29,6 +29,8 @@ extern void DefineIndex(RangeVar *heapRelation, bool unique, bool primary, bool isconstraint, + bool deferrable, + bool initdeferred, bool is_alter_table, bool check_rights, bool skip_build, diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h index 3e14bbe3ba..c92337a5a1 100644 --- a/src/include/commands/trigger.h +++ b/src/include/commands/trigger.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/trigger.h,v 1.74 2009/07/28 02:56:31 tgl Exp $ + * $PostgreSQL: pgsql/src/include/commands/trigger.h,v 1.75 2009/07/29 20:56:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -105,7 +105,7 @@ extern PGDLLIMPORT int SessionReplicationRole; #define TRIGGER_DISABLED 'D' extern Oid CreateTrigger(CreateTrigStmt *stmt, - Oid constraintOid, Oid indexOid, + Oid constraintOid, Oid indexOid, const char *prefix, bool checkPermissions); extern void DropTrigger(Oid relid, const char *trigname, @@ -132,7 +132,8 @@ extern HeapTuple ExecBRInsertTriggers(EState *estate, HeapTuple trigtuple); extern void ExecARInsertTriggers(EState *estate, ResultRelInfo *relinfo, - HeapTuple trigtuple); + HeapTuple trigtuple, + List *recheckIndexes); extern void ExecBSDeleteTriggers(EState *estate, ResultRelInfo *relinfo); extern void ExecASDeleteTriggers(EState *estate, @@ -154,7 +155,8 @@ extern HeapTuple ExecBRUpdateTriggers(EState *estate, extern void ExecARUpdateTriggers(EState *estate, ResultRelInfo *relinfo, ItemPointer tupleid, - HeapTuple newtuple); + HeapTuple newtuple, + List *recheckIndexes); extern void ExecBSTruncateTriggers(EState *estate, ResultRelInfo *relinfo); extern void ExecASTruncateTriggers(EState *estate, |
