From 2357fd166fb1d665af1fe8aceeed9a87829b2217 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 26 Jan 2003 23:16:23 +0000 Subject: [PATCH] Back-patch fixes to detoast pg_group.grolist. --- src/backend/commands/user.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index a7ccd3768f..55ce78e3a8 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.90 2001/11/05 17:46:25 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.90.2.1 2003/01/26 23:16:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,6 +27,7 @@ #include "libpq/crypt.h" #include "miscadmin.h" #include "storage/pmsignal.h" +#include "utils/acl.h" #include "utils/array.h" #include "utils/builtins.h" #include "utils/fmgroids.h" @@ -1075,7 +1076,7 @@ AlterGroup(AlterGroupStmt *stmt, const char *tag) Datum datum = heap_getattr(group_tuple, Anum_pg_group_grolist, pg_group_dsc, &null); int i; - oldarray = (ArrayType *) datum; + oldarray = null ? ((IdList *) NULL) : DatumGetIdListP(datum); Assert(null || ARR_NDIM(oldarray) == 1); /* first add the old array to the hitherto empty list */ if (!null) @@ -1195,7 +1196,7 @@ AlterGroup(AlterGroupStmt *stmt, const char *tag) *item; int i; - oldarray = (ArrayType *) datum; + oldarray = DatumGetIdListP(datum); Assert(ARR_NDIM(oldarray) == 1); /* first add the old array to the hitherto empty list */ for (i = ARR_LBOUND(oldarray)[0]; i < ARR_LBOUND(oldarray)[0] + ARR_DIMS(oldarray)[0]; i++) -- 2.50.0