aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/superuser.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-01-14 22:11:38 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-01-14 22:11:38 +0000
commit4ceb2d0cb619bba2ecbf5d72a10c8fa7ba321366 (patch)
treefedda3351400f98ed990320516f0eed80d6c1b73 /src/backend/utils/misc/superuser.c
parent2af360ed1c5036b8d488cdb6dc94f96608375769 (diff)
downloadpostgresql-4ceb2d0cb619bba2ecbf5d72a10c8fa7ba321366.tar.gz
postgresql-4ceb2d0cb619bba2ecbf5d72a10c8fa7ba321366.zip
* User management commands no longer user pg_exec_query_dest -> more robust
* Let unprivileged users change their own passwords. * The password is now an Sconst in the parser, which better reflects its text datatype and also forces users to quote them. * If your password is NULL you won't be written to the password file, meaning you can't connect until you have a password set up (if you use password authentication). * When you drop a user that owns a database you get an error. The database is not gone.
Diffstat (limited to 'src/backend/utils/misc/superuser.c')
-rw-r--r--src/backend/utils/misc/superuser.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/utils/misc/superuser.c b/src/backend/utils/misc/superuser.c
index c1f0a3231db..51d0d29c7b6 100644
--- a/src/backend/utils/misc/superuser.c
+++ b/src/backend/utils/misc/superuser.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.12 1999/11/24 16:52:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.13 2000/01/14 22:11:36 petere Exp $
*
* DESCRIPTION
* See superuser().
@@ -18,6 +18,7 @@
#include "postgres.h"
#include "catalog/pg_shadow.h"
#include "utils/syscache.h"
+#include "miscadmin.h"
bool
superuser(void)
@@ -26,12 +27,10 @@ superuser(void)
The Postgres user running this command has Postgres superuser
privileges.
--------------------------------------------------------------------------*/
- extern char *UserName; /* defined in global.c */
-
HeapTuple utup;
utup = SearchSysCacheTuple(SHADOWNAME,
- PointerGetDatum(UserName),
+ PointerGetDatum(GetPgUserName()),
0, 0, 0);
Assert(utup != NULL);
return ((Form_pg_shadow) GETSTRUCT(utup))->usesuper;