@@ -310,13 +310,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
310
310
{
311
311
int save_errno = errno ;
312
312
313
- /*
314
- * During bootstrap, there are cases where a system relation will be
315
- * accessed (by internal backend processes) before the bootstrap
316
- * script nominally creates it. Therefore, allow the file to exist
317
- * already, even if isRedo is not set. (See also mdopen)
318
- */
319
- if (isRedo || IsBootstrapProcessingMode ())
313
+ if (isRedo )
320
314
fd = PathNameOpenFile (path , O_RDWR | PG_BINARY );
321
315
if (fd < 0 )
322
316
{
@@ -572,26 +566,15 @@ mdopen(SMgrRelation reln, ForkNumber forknum, int behavior)
572
566
573
567
if (fd < 0 )
574
568
{
575
- /*
576
- * During bootstrap, there are cases where a system relation will be
577
- * accessed (by internal backend processes) before the bootstrap
578
- * script nominally creates it. Therefore, accept mdopen() as a
579
- * substitute for mdcreate() in bootstrap mode only. (See mdcreate)
580
- */
581
- if (IsBootstrapProcessingMode ())
582
- fd = PathNameOpenFile (path , O_RDWR | O_CREAT | O_EXCL | PG_BINARY );
583
- if (fd < 0 )
569
+ if ((behavior & EXTENSION_RETURN_NULL ) &&
570
+ FILE_POSSIBLY_DELETED (errno ))
584
571
{
585
- if ((behavior & EXTENSION_RETURN_NULL ) &&
586
- FILE_POSSIBLY_DELETED (errno ))
587
- {
588
- pfree (path );
589
- return NULL ;
590
- }
591
- ereport (ERROR ,
592
- (errcode_for_file_access (),
593
- errmsg ("could not open file \"%s\": %m" , path )));
572
+ pfree (path );
573
+ return NULL ;
594
574
}
575
+ ereport (ERROR ,
576
+ (errcode_for_file_access (),
577
+ errmsg ("could not open file \"%s\": %m" , path )));
595
578
}
596
579
597
580
pfree (path );
0 commit comments