diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-06-08 22:41:04 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-06-08 22:41:04 +0000 |
commit | 281a724d5cb8a5fea2f42e80575a768f5879b35c (patch) | |
tree | d1591cd101c1101eca0e7a4ecef572e05fae6810 /src/include | |
parent | cc87402d6e40994a53adeba0e11efb1bafcd6451 (diff) |
Rewrite DROP's dependency traversal algorithm into an honest two-pass
algorithm, replacing the original intention of a one-pass search, which
had been hacked up over time to be partially two-pass in hopes of handling
various corner cases better. It still wasn't quite there, especially as
regards emitting unwanted NOTICE messages. More importantly, this approach
lets us fix a number of open bugs concerning concurrent DROP scenarios,
because we can take locks during the first pass and avoid traversing to
dependent objects that were just deleted by someone else.
There is more that can be done here, but I'll go ahead and commit the
base patch before working on the options.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/genam.h | 3 | ||||
-rw-r--r-- | src/include/catalog/dependency.h | 7 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/include/access/genam.h b/src/include/access/genam.h index 21374f17d3d..c59c3b9d52f 100644 --- a/src/include/access/genam.h +++ b/src/include/access/genam.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/genam.h,v 1.72 2008/05/12 00:00:53 alvherre Exp $ + * $PostgreSQL: pgsql/src/include/access/genam.h,v 1.73 2008/06/08 22:41:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -138,6 +138,7 @@ extern SysScanDesc systable_beginscan(Relation heapRelation, Snapshot snapshot, int nkeys, ScanKey key); extern HeapTuple systable_getnext(SysScanDesc sysscan); +extern bool systable_recheck_tuple(SysScanDesc sysscan, HeapTuple tup); extern void systable_endscan(SysScanDesc sysscan); extern SysScanDesc systable_beginscan_ordered(Relation heapRelation, Relation indexRelation, diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h index e192c1ed288..8929be6a342 100644 --- a/src/include/catalog/dependency.h +++ b/src/include/catalog/dependency.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/dependency.h,v 1.35 2008/05/16 23:36:05 tgl Exp $ + * $PostgreSQL: pgsql/src/include/catalog/dependency.h,v 1.36 2008/06/08 22:41:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ #include "nodes/parsenodes.h" /* for DropBehavior */ -/*---------- +/* * Precise semantics of a dependency relationship are specified by the * DependencyType code (which is stored in a "char" field in pg_depend, * so we assign ASCII-code values to the enumeration members). @@ -56,7 +56,6 @@ * contain zeroes. * * Other dependency flavors may be needed in future. - *---------- */ typedef enum DependencyType @@ -178,7 +177,7 @@ extern void add_exact_object_address(const ObjectAddress *object, ObjectAddresses *addrs); extern bool object_address_present(const ObjectAddress *object, - ObjectAddresses *addrs); + const ObjectAddresses *addrs); extern void record_object_address_dependencies(const ObjectAddress *depender, ObjectAddresses *referenced, |