1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +03:00

Fixed everything in and surrounding createdb and dropdb to make it more

error-proof. Rearranged some old code and removed dead sections.
This commit is contained in:
Peter Eisentraut
2000-01-13 18:26:18 +00:00
parent bfa3b59d25
commit 46a28f1b14
14 changed files with 473 additions and 842 deletions

View File

@ -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);
/* in miscinit.c */
extern void ExitPostgres(ExitStatus status);
/* 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)
#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