summaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/misc.c5
-rw-r--r--src/backend/utils/init/globals.c4
-rw-r--r--src/backend/utils/init/miscinit.c18
-rw-r--r--src/backend/utils/init/postinit.c6
-rw-r--r--src/backend/utils/misc/superuser.c17
5 files changed, 7 insertions, 43 deletions
diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c
index 1f85e4f499..24d7964c90 100644
--- a/src/backend/utils/adt/misc.c
+++ b/src/backend/utils/adt/misc.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.28 2003/02/13 05:24:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.29 2003/06/27 14:45:30 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -54,7 +54,6 @@ current_database(PG_FUNCTION_ARGS)
db = (Name) palloc(NAMEDATALEN);
- namestrcpy(db, DatabaseName);
-
+ namestrcpy(db, get_database_name(MyDatabaseId));
PG_RETURN_NAME(db);
}
diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c
index 0a53556ec3..2a7a372fa6 100644
--- a/src/backend/utils/init/globals.c
+++ b/src/backend/utils/init/globals.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.71 2003/05/28 18:19:09 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.72 2003/06/27 14:45:30 petere Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
@@ -52,9 +52,7 @@ char pg_pathname[MAXPGPATH]; /* full path to postgres
BackendId MyBackendId;
-char *DatabaseName = NULL;
char *DatabasePath = NULL;
-
Oid MyDatabaseId = InvalidOid;
/* these are initialized for the bootstrap/standalone case: */
diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c
index 6ffd1e01b9..c3dc38f387 100644
--- a/src/backend/utils/init/miscinit.c
+++ b/src/backend/utils/init/miscinit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.102 2003/04/04 20:42:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.103 2003/06/27 14:45:30 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -105,22 +105,6 @@ SetDatabasePath(const char *path)
}
}
-void
-SetDatabaseName(const char *name)
-{
- if (DatabaseName)
- {
- free(DatabaseName);
- DatabaseName = NULL;
- }
- /* use strdup since this is done before memory contexts are set up */
- if (name)
- {
- DatabaseName = strdup(name);
- AssertState(DatabaseName);
- }
-}
-
/*
* Set data directory, but make sure it's an absolute path. Use this,
* never set DataDir directly.
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 8fda5d185e..48194071e5 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.121 2003/05/14 03:26:02 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.122 2003/06/27 14:45:30 petere Exp $
*
*
*-------------------------------------------------------------------------
@@ -228,13 +228,11 @@ InitPostgres(const char *dbname, const char *username)
bool bootstrap = IsBootstrapProcessingMode();
/*
- * Set up the global variables holding database name, id, and path.
+ * Set up the global variables holding database id and path.
*
* We take a shortcut in the bootstrap case, otherwise we have to look up
* the db name in pg_database.
*/
- SetDatabaseName(dbname);
-
if (bootstrap)
{
MyDatabaseId = TemplateDbOid;
diff --git a/src/backend/utils/misc/superuser.c b/src/backend/utils/misc/superuser.c
index dee8da747d..e398d8d001 100644
--- a/src/backend/utils/misc/superuser.c
+++ b/src/backend/utils/misc/superuser.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.25 2002/12/05 04:04:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.26 2003/06/27 14:45:31 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -58,18 +58,3 @@ superuser_arg(AclId userid)
}
return result;
}
-
-
-/*
- * The Postgres user running this command is the owner of the specified
- * database.
- */
-bool
-is_dbadmin(Oid dbid)
-{
- AclId dba;
-
- dba = get_database_owner(dbid);
-
- return (GetUserId() == dba);
-}