]> granicus.if.org Git - postgresql/blobdiff - src/backend/catalog/pg_range.c
Update copyright for 2016
[postgresql] / src / backend / catalog / pg_range.c
index 07bfe4ab2702fae4087ce8d15687f8b3f5d2958d..84e7733e74f2983c619c220c3baa1a7dc1dfc935 100644 (file)
@@ -3,7 +3,8 @@
  * pg_range.c
  *       routines to support manipulation of the pg_range relation
  *
- * Copyright (c) 2006-2010, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
  * IDENTIFICATION
@@ -15,6 +16,7 @@
 
 #include "access/genam.h"
 #include "access/heapam.h"
+#include "access/htup_details.h"
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/pg_collation.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_range.h"
 #include "catalog/pg_type.h"
-#include "utils/builtins.h"
 #include "utils/fmgroids.h"
-#include "utils/tqual.h"
 #include "utils/rel.h"
+#include "utils/tqual.h"
+
 
 /*
  * RangeCreate
@@ -45,7 +47,7 @@ RangeCreate(Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation,
 
        pg_range = heap_open(RangeRelationId, RowExclusiveLock);
 
-       memset(nulls, 0, Natts_pg_range * sizeof(bool));
+       memset(nulls, 0, sizeof(nulls));
 
        values[Anum_pg_range_rngtypid - 1] = ObjectIdGetDatum(rangeTypeOid);
        values[Anum_pg_range_rngsubtype - 1] = ObjectIdGetDatum(rangeSubType);
@@ -55,11 +57,12 @@ RangeCreate(Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation,
        values[Anum_pg_range_rngsubdiff - 1] = ObjectIdGetDatum(rangeSubDiff);
 
        tup = heap_form_tuple(RelationGetDescr(pg_range), values, nulls);
+
        simple_heap_insert(pg_range, tup);
        CatalogUpdateIndexes(pg_range, tup);
        heap_freetuple(tup);
 
-       /* record dependencies */
+       /* record type's dependencies on range-related items */
 
        myself.classId = TypeRelationId;
        myself.objectId = rangeTypeOid;
@@ -105,7 +108,7 @@ RangeCreate(Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation,
 
 /*
  * RangeDelete
- *             Remove the pg_range entry.
+ *             Remove the pg_range entry for the specified type.
  */
 void
 RangeDelete(Oid rangeTypeOid)
@@ -123,7 +126,7 @@ RangeDelete(Oid rangeTypeOid)
                                ObjectIdGetDatum(rangeTypeOid));
 
        scan = systable_beginscan(pg_range, RangeTypidIndexId, true,
-                                                         SnapshotNow, 1, key);
+                                                         NULL, 1, key);
 
        while (HeapTupleIsValid(tup = systable_getnext(scan)))
        {