superuser.c

来自「关系型数据库 Postgresql 6.5.2」· C语言 代码 · 共 39 行

C
39
字号
/*------------------------------------------------------------------------- * * superuser.c * *	  The superuser() function.  Determines if user has superuser privilege. * * Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION *	  $Header: /usr/local/cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.8.2.1 1999/08/02 05:25:14 scrappy Exp $ * * DESCRIPTION *	  See superuser(). *------------------------------------------------------------------------- */#include "postgres.h"#include "catalog/pg_shadow.h"#include "utils/syscache.h"boolsuperuser(void){/*--------------------------------------------------------------------------	The Postgres user running this command has Postgres superuser	privileges.--------------------------------------------------------------------------*/	extern char *UserName;		/* defined in global.c */	HeapTuple	utup;	utup = SearchSysCacheTuple(USENAME,							   PointerGetDatum(UserName),							   0, 0, 0);	Assert(utup != NULL);	return ((Form_pg_shadow) GETSTRUCT(utup))->usesuper;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?