Go to the source code of this file.
◆ UNLOGGED_RELATION_CLEANUP
#define UNLOGGED_RELATION_CLEANUP 0x0001 |
◆ UNLOGGED_RELATION_INIT
#define UNLOGGED_RELATION_INIT 0x0002 |
◆ parse_filename_for_nontemp_relation()
bool parse_filename_for_nontemp_relation |
( |
const char * |
name, |
|
|
RelFileNumber * |
relnumber, |
|
|
ForkNumber * |
fork, |
|
|
unsigned * |
segno |
|
) |
| |
Definition at line 380 of file reinit.c.
382{
383 unsigned long n,
384 s;
386 char *endp;
387
390 *segno = 0;
391
392
393
394
395
396
397
398
399
400
401
403 return false;
404
405
406
407
408
409 errno = 0;
410 n = strtoul(
name, &endp, 10);
412 return false;
414
415
418 else
419 {
420 int forkchar;
421
423 if (forkchar <= 0)
424 return false;
425 name += forkchar + 1;
426 }
427
428
430 s = 0;
431 else
432 {
433
435 return false;
436
437 errno = 0;
438 s = strtoul(
name + 1, &endp, 10);
440 return false;
442 }
443
444
446 return false;
447
448
450 *fork = f;
451 *segno = (unsigned) s;
452 return true;
453}
int forkname_chars(const char *str, ForkNumber *fork)
#define InvalidRelFileNumber
References forkname_chars(), InvalidForkNumber, InvalidRelFileNumber, MAIN_FORKNUM, name, and PG_UINT32_MAX.
Referenced by ResetUnloggedRelationsInDbspaceDir(), and sendDir().
◆ ResetUnloggedRelations()
void ResetUnloggedRelations |
( |
int |
op | ) |
|
Definition at line 47 of file reinit.c.
48{
53 oldctx;
54
55
56 elog(
DEBUG1,
"resetting unlogged relations: cleanup %d init %d",
59
60
61
62
63
65 "ResetUnloggedRelations",
68
69
71
72
73
74
76
77
78
79
81
83 {
84 if (strcmp(spc_de->
d_name,
".") == 0 ||
85 strcmp(spc_de->
d_name,
"..") == 0)
86 continue;
87
88 snprintf(temp_path,
sizeof(temp_path),
"%s/%s/%s",
91 }
92
94
95
96
97
100}
void begin_startup_progress_phase(void)
DIR * AllocateDir(const char *dirname)
struct dirent * ReadDir(DIR *dir, const char *dirname)
MemoryContext CurrentMemoryContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static void ResetUnloggedRelationsInTablespaceDir(const char *tsdirname, int op)
#define UNLOGGED_RELATION_INIT
#define UNLOGGED_RELATION_CLEANUP
#define TABLESPACE_VERSION_DIRECTORY
References AllocateDir(), ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, begin_startup_progress_phase(), CurrentMemoryContext, dirent::d_name, DEBUG1, elog, FreeDir(), MAXPGPATH, MemoryContextDelete(), MemoryContextSwitchTo(), PG_TBLSPC_DIR, ReadDir(), ResetUnloggedRelationsInTablespaceDir(), snprintf, TABLESPACE_VERSION_DIRECTORY, UNLOGGED_RELATION_CLEANUP, and UNLOGGED_RELATION_INIT.
Referenced by StartupXLOG().