diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2000-01-13 18:26:18 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2000-01-13 18:26:18 +0000 |
commit | 46a28f1b14ee9d42cdec82d24c962a1274bbd076 (patch) | |
tree | 64249d62a4def09c270f338ca0ac681905d85470 /src/include/miscadmin.h | |
parent | bfa3b59d2501e7b9d8e4480a1ad7feb3cdeaa703 (diff) | |
download | postgresql-46a28f1b14ee9d42cdec82d24c962a1274bbd076.tar.gz postgresql-46a28f1b14ee9d42cdec82d24c962a1274bbd076.zip |
Fixed everything in and surrounding createdb and dropdb to make it more
error-proof. Rearranged some old code and removed dead sections.
Diffstat (limited to 'src/include/miscadmin.h')
-rw-r--r-- | src/include/miscadmin.h | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 4212c50dc5f..ee88a8a5efc 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -11,7 +11,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: miscadmin.h,v 1.46 2000/01/09 12:19:27 ishii Exp $ + * $Id: miscadmin.h,v 1.47 2000/01/13 18:26:15 petere Exp $ * * NOTES * some of the information in this file will be moved to @@ -47,6 +47,8 @@ extern long MyCancelKey; extern char OutputFileName[]; +extern char *UserName; + /* * done in storage/backendid.h for now. * @@ -110,13 +112,12 @@ extern char *DatabaseName; extern char *DatabasePath; /* in utils/misc/database.c */ -extern void GetRawDatabaseInfo(char *name, Oid *db_id, char *path); -extern int GetDatabaseInfo(char *name, int4 *owner, char *path); -extern char *ExpandDatabasePath(char *path); +extern void GetRawDatabaseInfo(const char *name, Oid *db_id, char *path); +extern char *ExpandDatabasePath(const char *path); /* now in utils/init/miscinit.c */ -extern void SetDatabaseName(char *name); -extern void SetDatabasePath(char *path); +extern void SetDatabaseName(const char *name); +extern void SetDatabasePath(const char *path); /* even if MB is not enabled, this function is neccesary * since pg_proc.h does have. @@ -184,16 +185,27 @@ typedef int16 ExitStatus; extern bool PostgresIsInitialized; -extern void InitPostgres(char *name); +extern void InitPostgres(const char *dbname); + +/* one of the ways to get out of here */ +#define ExitPostgres(status) proc_exec(status) + +/* processing mode support stuff */ +extern ProcessingMode Mode; + +#define IsBootstrapProcessingMode() ((bool)(Mode == BootstrapProcessing)) +#define IsInitProcessingMode() ((bool)(Mode == InitProcessing)) +#define IsNormalProcessingMode() ((bool)(Mode == NormalProcessing)) + +#define SetProcessingMode(mode) \ + do { \ + AssertArg(mode == BootstrapProcessing || mode == InitProcessing || \ + mode == NormalProcessing); \ + Mode = mode; \ + } while(0) -/* in miscinit.c */ -extern void ExitPostgres(ExitStatus status); +#define GetProcessingMode() Mode -extern bool IsBootstrapProcessingMode(void); -extern bool IsInitProcessingMode(void); -extern bool IsNormalProcessingMode(void); -extern void SetProcessingMode(ProcessingMode mode); -extern ProcessingMode GetProcessingMode(void); /* * "postmaster.pid" is a file containing postmaster's pid, being |