aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/postinit.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-06-18 06:14:31 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-06-18 06:14:31 +0000
commit2467394ee1566e82d0314d12a0d1c0a5670a28c9 (patch)
tree57b87b8c181a9c3eb0f33bf775a5f31b9de8b890 /src/backend/utils/init/postinit.c
parent474875f4438ea0d18f9f4170117bc407e6812515 (diff)
downloadpostgresql-2467394ee1566e82d0314d12a0d1c0a5670a28c9.tar.gz
postgresql-2467394ee1566e82d0314d12a0d1c0a5670a28c9.zip
Tablespaces. Alternate database locations are dead, long live tablespaces.
There are various things left to do: contrib dbsize and oid2name modules need work, and so does the documentation. Also someone should think about COMMENT ON TABLESPACE and maybe RENAME TABLESPACE. Also initlocation is dead, it just doesn't know it yet. Gavin Sherry and Tom Lane.
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r--src/backend/utils/init/postinit.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index e80187d5752..48d28d429f2 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.133 2004/05/29 22:48:21 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.134 2004/06/18 06:13:54 tgl Exp $
*
*
*-------------------------------------------------------------------------
@@ -26,6 +26,7 @@
#include "catalog/namespace.h"
#include "catalog/pg_database.h"
#include "catalog/pg_shadow.h"
+#include "catalog/pg_tablespace.h"
#include "commands/trigger.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
@@ -239,12 +240,12 @@ InitPostgres(const char *dbname, const char *username)
if (bootstrap)
{
MyDatabaseId = TemplateDbOid;
- SetDatabasePath(GetDatabasePath(MyDatabaseId));
+ MyDatabaseTableSpace = DEFAULTTABLESPACE_OID;
+ SetDatabasePath(GetDatabasePath(MyDatabaseId, MyDatabaseTableSpace));
}
else
{
- char *fullpath,
- datpath[MAXPGPATH];
+ char *fullpath;
/*
* Formerly we validated DataDir here, but now that's done
@@ -252,11 +253,11 @@ InitPostgres(const char *dbname, const char *username)
*/
/*
- * Find oid and path of the database we're about to open. Since
- * we're not yet up and running we have to use the hackish
+ * Find oid and tablespace of the database we're about to open.
+ * Since we're not yet up and running we have to use the hackish
* GetRawDatabaseInfo.
*/
- GetRawDatabaseInfo(dbname, &MyDatabaseId, datpath);
+ GetRawDatabaseInfo(dbname, &MyDatabaseId, &MyDatabaseTableSpace);
if (!OidIsValid(MyDatabaseId))
ereport(FATAL,
@@ -264,7 +265,7 @@ InitPostgres(const char *dbname, const char *username)
errmsg("database \"%s\" does not exist",
dbname)));
- fullpath = GetDatabasePath(MyDatabaseId);
+ fullpath = GetDatabasePath(MyDatabaseId, MyDatabaseTableSpace);
/* Verify the database path */