1 /*-------------------------------------------------------------------------
5 * The superuser() function. Determines if user has superuser privilege.
7 * Copyright (c) 1994, Regents of the University of California
11 * $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.11 1999/11/22 17:56:35 momjian Exp $
15 *-------------------------------------------------------------------------
19 #include "catalog/pg_shadow.h"
20 #include "utils/syscache.h"
25 /*--------------------------------------------------------------------------
26 The Postgres user running this command has Postgres superuser
28 --------------------------------------------------------------------------*/
29 extern char *UserName; /* defined in global.c */
33 utup = SearchSysCacheTuple(USERNAME,
34 PointerGetDatum(UserName),
37 return ((Form_pg_shadow) GETSTRUCT(utup))->usesuper;