* pg_db_role_setting.c
* Routines to support manipulation of the pg_db_role_setting relation
*
- * Portions Copyright (c) 1996-2012, 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/indexing.h"
+#include "catalog/objectaccess.h"
#include "catalog/pg_db_role_setting.h"
#include "utils/fmgroids.h"
#include "utils/rel.h"
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(roleid));
scan = systable_beginscan(rel, DbRoleSettingDatidRolidIndexId, true,
- SnapshotNow, 2, scankey);
+ NULL, 2, scankey);
tuple = systable_getnext(scan);
/*
CatalogUpdateIndexes(rel, newtuple);
}
+ InvokeObjectPostAlterHookArg(DbRoleSettingRelationId,
+ databaseid, 0, roleid, false);
+
systable_endscan(scan);
/* Close pg_db_role_setting, but keep lock till commit */
/*
* Drop some settings from the catalog. These can be for a particular
- * database, or for a particular role. (It is of course possible to do both
+ * database, or for a particular role. (It is of course possible to do both
* too, but it doesn't make sense for current uses.)
*/
void
numkeys++;
}
- scan = heap_beginscan(relsetting, SnapshotNow, numkeys, keys);
+ scan = heap_beginscan_catalog(relsetting, numkeys, keys);
while (HeapTupleIsValid(tup = heap_getnext(scan, ForwardScanDirection)))
{
simple_heap_delete(relsetting, &tup->t_self);
* databaseid/roleid.
*/
void
-ApplySetting(Oid databaseid, Oid roleid, Relation relsetting, GucSource source)
+ApplySetting(Snapshot snapshot, Oid databaseid, Oid roleid,
+ Relation relsetting, GucSource source)
{
SysScanDesc scan;
ScanKeyData keys[2];
ObjectIdGetDatum(roleid));
scan = systable_beginscan(relsetting, DbRoleSettingDatidRolidIndexId, true,
- SnapshotNow, 2, keys);
+ snapshot, 2, keys);
while (HeapTupleIsValid(tup = systable_getnext(scan)))
{
bool isnull;