Definition at line 3015 of file dbcommands.c.
3038 if (
stat(dst_path, &st) == 0 &&
S_ISDIR(st.st_mode))
3040 if (!
rmtree(dst_path,
true))
3043 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
3061 copydir(src_path, dst_path,
false);
3121 if (!
rmtree(dst_path,
true))
3123 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
3141 elog(
PANIC,
"dbase_redo: unknown op code %u", info);
void DropDatabaseBuffers(Oid dbid)
void FlushDatabaseBuffers(Oid dbid)
void copydir(char *fromdir, char *todir, bool recurse)
static void CreateDirAndVersionFile(char *dbpath, Oid dbid, Oid tsid, bool isRedo)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
Assert(fmt[strlen(fmt) - 1] !='\n')
void UnlockSharedObjectForSession(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
void LockSharedObjectForSession(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
#define AccessExclusiveLock
void pfree(void *pointer)
void ForgetDatabaseSyncRequests(Oid dbid)
void WaitForProcSignalBarrier(uint64 generation)
uint64 EmitProcSignalBarrier(ProcSignalBarrierType type)
@ PROCSIGNAL_BARRIER_SMGRRELEASE
char * GetDatabasePath(Oid dbNode, Oid spcNode)
bool rmtree(const char *path, bool rmtopdir)
void ReplicationSlotsDropDBSlots(Oid dboid)
void ResolveRecoveryConflictWithDatabase(Oid dbid)
#define XLogRecHasAnyBlockRefs(decoder)
void XLogDropDatabase(Oid dbid)
References AccessExclusiveLock, Assert(), copydir(), CreateDirAndVersionFile(), xl_dbase_create_file_copy_rec::db_id, xl_dbase_create_wal_log_rec::db_id, xl_dbase_drop_rec::db_id, DropDatabaseBuffers(), elog, EmitProcSignalBarrier(), ereport, errmsg(), FlushDatabaseBuffers(), ForgetDatabaseSyncRequests(), GetDatabasePath(), i, InHotStandby, LockSharedObjectForSession(), xl_dbase_drop_rec::ntablespaces, PANIC, pfree(), PROCSIGNAL_BARRIER_SMGRRELEASE, ReplicationSlotsDropDBSlots(), ResolveRecoveryConflictWithDatabase(), rmtree(), S_ISDIR, xl_dbase_create_file_copy_rec::src_db_id, xl_dbase_create_file_copy_rec::src_tablespace_id, stat::st_mode, stat, xl_dbase_create_file_copy_rec::tablespace_id, xl_dbase_create_wal_log_rec::tablespace_id, xl_dbase_drop_rec::tablespace_ids, UnlockSharedObjectForSession(), WaitForProcSignalBarrier(), WARNING, XLOG_DBASE_CREATE_FILE_COPY, XLOG_DBASE_CREATE_WAL_LOG, XLOG_DBASE_DROP, XLogDropDatabase(), XLogRecGetData, XLogRecGetInfo, XLogRecHasAnyBlockRefs, and XLR_INFO_MASK.