mirror of
https://github.com/postgres/postgres.git
synced 2025-11-28 11:44:57 +03:00
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
@@ -472,7 +472,7 @@ mdunlinkfork(RelFileNodeBackend rnode, ForkNumber forkNum, bool isRedo)
|
||||
if (errno != ENOENT)
|
||||
ereport(WARNING,
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not remove file \"%s\": %m", segpath)));
|
||||
errmsg("could not remove file \"%s\": %m", segpath)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -997,9 +997,9 @@ mdtruncate(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks)
|
||||
if (FileTruncate(v->mdfd_vfd, (off_t) lastsegblocks * BLCKSZ, WAIT_EVENT_DATA_FILE_TRUNCATE) < 0)
|
||||
ereport(ERROR,
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not truncate file \"%s\" to %u blocks: %m",
|
||||
FilePathName(v->mdfd_vfd),
|
||||
nblocks)));
|
||||
errmsg("could not truncate file \"%s\" to %u blocks: %m",
|
||||
FilePathName(v->mdfd_vfd),
|
||||
nblocks)));
|
||||
if (!SmgrIsTemp(reln))
|
||||
register_dirty_segment(reln, forknum, v);
|
||||
}
|
||||
@@ -1225,7 +1225,7 @@ mdsync(void)
|
||||
|
||||
/* Attempt to open and fsync the target segment */
|
||||
seg = _mdfd_getseg(reln, forknum,
|
||||
(BlockNumber) segno * (BlockNumber) RELSEG_SIZE,
|
||||
(BlockNumber) segno * (BlockNumber) RELSEG_SIZE,
|
||||
false,
|
||||
EXTENSION_RETURN_NULL
|
||||
| EXTENSION_DONT_CHECK_SIZE);
|
||||
@@ -1233,7 +1233,7 @@ mdsync(void)
|
||||
INSTR_TIME_SET_CURRENT(sync_start);
|
||||
|
||||
if (seg != NULL &&
|
||||
FileSync(seg->mdfd_vfd, WAIT_EVENT_DATA_FILE_SYNC) >= 0)
|
||||
FileSync(seg->mdfd_vfd, WAIT_EVENT_DATA_FILE_SYNC) >= 0)
|
||||
{
|
||||
/* Success; update statistics about sync timing */
|
||||
INSTR_TIME_SET_CURRENT(sync_end);
|
||||
@@ -1279,8 +1279,8 @@ mdsync(void)
|
||||
else
|
||||
ereport(DEBUG1,
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not fsync file \"%s\" but retrying: %m",
|
||||
path)));
|
||||
errmsg("could not fsync file \"%s\" but retrying: %m",
|
||||
path)));
|
||||
pfree(path);
|
||||
|
||||
/*
|
||||
@@ -1925,9 +1925,9 @@ _mdfd_getseg(SMgrRelation reln, ForkNumber forknum, BlockNumber blkno,
|
||||
return NULL;
|
||||
ereport(ERROR,
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not open file \"%s\" (target block %u): %m",
|
||||
_mdfd_segpath(reln, forknum, nextsegno),
|
||||
blkno)));
|
||||
errmsg("could not open file \"%s\" (target block %u): %m",
|
||||
_mdfd_segpath(reln, forknum, nextsegno),
|
||||
blkno)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,13 +46,13 @@ typedef struct f_smgr
|
||||
void (*smgr_unlink) (RelFileNodeBackend rnode, ForkNumber forknum,
|
||||
bool isRedo);
|
||||
void (*smgr_extend) (SMgrRelation reln, ForkNumber forknum,
|
||||
BlockNumber blocknum, char *buffer, bool skipFsync);
|
||||
BlockNumber blocknum, char *buffer, bool skipFsync);
|
||||
void (*smgr_prefetch) (SMgrRelation reln, ForkNumber forknum,
|
||||
BlockNumber blocknum);
|
||||
void (*smgr_read) (SMgrRelation reln, ForkNumber forknum,
|
||||
BlockNumber blocknum, char *buffer);
|
||||
void (*smgr_write) (SMgrRelation reln, ForkNumber forknum,
|
||||
BlockNumber blocknum, char *buffer, bool skipFsync);
|
||||
BlockNumber blocknum, char *buffer, bool skipFsync);
|
||||
void (*smgr_writeback) (SMgrRelation reln, ForkNumber forknum,
|
||||
BlockNumber blocknum, BlockNumber nblocks);
|
||||
BlockNumber (*smgr_nblocks) (SMgrRelation reln, ForkNumber forknum);
|
||||
|
||||
Reference in New Issue
Block a user