* 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
#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
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);
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;
/*
* RangeDelete
- * Remove the pg_range entry.
+ * Remove the pg_range entry for the specified type.
*/
void
RangeDelete(Oid rangeTypeOid)
ObjectIdGetDatum(rangeTypeOid));
scan = systable_beginscan(pg_range, RangeTypidIndexId, true,
- SnapshotNow, 1, key);
+ NULL, 1, key);
while (HeapTupleIsValid(tup = systable_getnext(scan)))
{