1 /*-------------------------------------------------------------------------
5 * The superuser() function. Determines if user has superuser privilege.
7 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
12 * $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.17 2001/01/24 19:43:16 momjian Exp $
16 *-------------------------------------------------------------------------
20 #include "catalog/pg_shadow.h"
21 #include "utils/syscache.h"
22 #include "miscadmin.h"
27 /*--------------------------------------------------------------------------
28 The Postgres user running this command has Postgres superuser
30 --------------------------------------------------------------------------*/
34 utup = SearchSysCache(SHADOWSYSID,
35 ObjectIdGetDatum(GetUserId()),
37 if (HeapTupleIsValid(utup))
39 result = ((Form_pg_shadow) GETSTRUCT(utup))->usesuper;
40 ReleaseSysCache(utup);