mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +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:
@ -429,7 +429,7 @@ dsm_backend_startup(void)
|
||||
&dsm_control_mapped_size, WARNING);
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_INTERNAL_ERROR),
|
||||
errmsg("dynamic shared memory control segment is not valid")));
|
||||
errmsg("dynamic shared memory control segment is not valid")));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -935,7 +935,7 @@ dsm_unpin_segment(dsm_handle handle)
|
||||
* dsm_impl_unpin_segment.
|
||||
*/
|
||||
dsm_impl_unpin_segment(handle,
|
||||
&dsm_control->item[control_slot].impl_private_pm_handle);
|
||||
&dsm_control->item[control_slot].impl_private_pm_handle);
|
||||
|
||||
/* Note that 1 means no references (0 means unused slot). */
|
||||
if (--dsm_control->item[control_slot].refcnt == 1)
|
||||
|
@ -258,8 +258,8 @@ dsm_impl_posix(dsm_op op, dsm_handle handle, Size request_size,
|
||||
{
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
*mapped_address = NULL;
|
||||
@ -268,8 +268,8 @@ dsm_impl_posix(dsm_op op, dsm_handle handle, Size request_size,
|
||||
{
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not remove shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not remove shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -358,8 +358,8 @@ dsm_impl_posix(dsm_op op, dsm_handle handle, Size request_size,
|
||||
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
*mapped_address = NULL;
|
||||
@ -530,8 +530,8 @@ dsm_impl_sysv(dsm_op op, dsm_handle handle, Size request_size,
|
||||
{
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
*mapped_address = NULL;
|
||||
@ -540,8 +540,8 @@ dsm_impl_sysv(dsm_op op, dsm_handle handle, Size request_size,
|
||||
{
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not remove shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not remove shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -645,8 +645,8 @@ dsm_impl_windows(dsm_op op, dsm_handle handle, Size request_size,
|
||||
_dosmaperr(GetLastError());
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
if (*impl_private != NULL
|
||||
@ -655,8 +655,8 @@ dsm_impl_windows(dsm_op op, dsm_handle handle, Size request_size,
|
||||
_dosmaperr(GetLastError());
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not remove shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not remove shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -711,8 +711,8 @@ dsm_impl_windows(dsm_op op, dsm_handle handle, Size request_size,
|
||||
_dosmaperr(errcode);
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not create shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not create shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -816,8 +816,8 @@ dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size,
|
||||
{
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
*mapped_address = NULL;
|
||||
@ -826,8 +826,8 @@ dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size,
|
||||
{
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not remove shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not remove shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -960,8 +960,8 @@ dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size,
|
||||
|
||||
ereport(elevel,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not unmap shared memory segment \"%s\": %m",
|
||||
name)));
|
||||
return false;
|
||||
}
|
||||
*mapped_address = NULL;
|
||||
@ -1026,8 +1026,8 @@ dsm_impl_pin_segment(dsm_handle handle, void *impl_private,
|
||||
_dosmaperr(GetLastError());
|
||||
ereport(ERROR,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not duplicate handle for \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not duplicate handle for \"%s\": %m",
|
||||
name)));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1074,8 +1074,8 @@ dsm_impl_unpin_segment(dsm_handle handle, void **impl_private)
|
||||
_dosmaperr(GetLastError());
|
||||
ereport(ERROR,
|
||||
(errcode_for_dynamic_shared_memory(),
|
||||
errmsg("could not duplicate handle for \"%s\": %m",
|
||||
name)));
|
||||
errmsg("could not duplicate handle for \"%s\": %m",
|
||||
name)));
|
||||
}
|
||||
|
||||
*impl_private = NULL;
|
||||
|
@ -198,7 +198,7 @@ proc_exit_prepare(int code)
|
||||
*/
|
||||
while (--on_proc_exit_index >= 0)
|
||||
(*on_proc_exit_list[on_proc_exit_index].function) (code,
|
||||
on_proc_exit_list[on_proc_exit_index].arg);
|
||||
on_proc_exit_list[on_proc_exit_index].arg);
|
||||
|
||||
on_proc_exit_index = 0;
|
||||
}
|
||||
@ -226,7 +226,7 @@ shmem_exit(int code)
|
||||
code, before_shmem_exit_index);
|
||||
while (--before_shmem_exit_index >= 0)
|
||||
(*before_shmem_exit_list[before_shmem_exit_index].function) (code,
|
||||
before_shmem_exit_list[before_shmem_exit_index].arg);
|
||||
before_shmem_exit_list[before_shmem_exit_index].arg);
|
||||
before_shmem_exit_index = 0;
|
||||
|
||||
/*
|
||||
@ -259,7 +259,7 @@ shmem_exit(int code)
|
||||
code, on_shmem_exit_index);
|
||||
while (--on_shmem_exit_index >= 0)
|
||||
(*on_shmem_exit_list[on_shmem_exit_index].function) (code,
|
||||
on_shmem_exit_list[on_shmem_exit_index].arg);
|
||||
on_shmem_exit_list[on_shmem_exit_index].arg);
|
||||
on_shmem_exit_index = 0;
|
||||
}
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ WaitEventSetWaitBlock(WaitEventSet *set, int cur_timeout,
|
||||
}
|
||||
}
|
||||
else if (cur_event->events == WL_POSTMASTER_DEATH &&
|
||||
(cur_pollfd->revents & (POLLIN | POLLHUP | POLLERR | POLLNVAL)))
|
||||
(cur_pollfd->revents & (POLLIN | POLLHUP | POLLERR | POLLNVAL)))
|
||||
{
|
||||
/*
|
||||
* We expect an POLLHUP when the remote end is closed, but because
|
||||
|
@ -732,8 +732,8 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
|
||||
}
|
||||
else
|
||||
elog(trace_recovery(DEBUG1),
|
||||
"recovery snapshot waiting for non-overflowed snapshot or "
|
||||
"until oldest active xid on standby is at least %u (now %u)",
|
||||
"recovery snapshot waiting for non-overflowed snapshot or "
|
||||
"until oldest active xid on standby is at least %u (now %u)",
|
||||
standbySnapshotPendingXmin,
|
||||
running->oldestRunningXid);
|
||||
return;
|
||||
@ -3243,7 +3243,7 @@ RecordKnownAssignedTransactionIds(TransactionId xid)
|
||||
*/
|
||||
void
|
||||
ExpireTreeKnownAssignedTransactionIds(TransactionId xid, int nsubxids,
|
||||
TransactionId *subxids, TransactionId max_xid)
|
||||
TransactionId *subxids, TransactionId max_xid)
|
||||
{
|
||||
Assert(standbyState >= STANDBY_INITIALIZED);
|
||||
|
||||
|
@ -253,6 +253,6 @@ Size
|
||||
shm_toc_estimate(shm_toc_estimator *e)
|
||||
{
|
||||
return add_size(offsetof(shm_toc, toc_entry),
|
||||
add_size(mul_size(e->number_of_keys, sizeof(shm_toc_entry)),
|
||||
e->space_for_chunks));
|
||||
add_size(mul_size(e->number_of_keys, sizeof(shm_toc_entry)),
|
||||
e->space_for_chunks));
|
||||
}
|
||||
|
@ -418,8 +418,8 @@ ShmemInitStruct(const char *name, Size size, bool *foundPtr)
|
||||
LWLockRelease(ShmemIndexLock);
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OUT_OF_MEMORY),
|
||||
errmsg("could not create ShmemIndex entry for data structure \"%s\"",
|
||||
name)));
|
||||
errmsg("could not create ShmemIndex entry for data structure \"%s\"",
|
||||
name)));
|
||||
}
|
||||
|
||||
if (*foundPtr)
|
||||
@ -433,9 +433,9 @@ ShmemInitStruct(const char *name, Size size, bool *foundPtr)
|
||||
{
|
||||
LWLockRelease(ShmemIndexLock);
|
||||
ereport(ERROR,
|
||||
(errmsg("ShmemIndex entry size is wrong for data structure"
|
||||
" \"%s\": expected %zu, actual %zu",
|
||||
name, size, result->size)));
|
||||
(errmsg("ShmemIndex entry size is wrong for data structure"
|
||||
" \"%s\": expected %zu, actual %zu",
|
||||
name, size, result->size)));
|
||||
}
|
||||
structPtr = result->location;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ SendSharedInvalidMessages(const SharedInvalidationMessage *msgs, int n)
|
||||
*/
|
||||
void
|
||||
ReceiveSharedInvalidMessages(
|
||||
void (*invalFunction) (SharedInvalidationMessage *msg),
|
||||
void (*invalFunction) (SharedInvalidationMessage *msg),
|
||||
void (*resetFunction) (void))
|
||||
{
|
||||
#define MAXINVALMSGS 32
|
||||
|
@ -284,7 +284,7 @@ ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid, RelFileNode
|
||||
node.dbNode);
|
||||
|
||||
ResolveRecoveryConflictWithVirtualXIDs(backends,
|
||||
PROCSIG_RECOVERY_CONFLICT_SNAPSHOT);
|
||||
PROCSIG_RECOVERY_CONFLICT_SNAPSHOT);
|
||||
}
|
||||
|
||||
void
|
||||
@ -312,7 +312,7 @@ ResolveRecoveryConflictWithTablespace(Oid tsid)
|
||||
temp_file_users = GetConflictingVirtualXIDs(InvalidTransactionId,
|
||||
InvalidOid);
|
||||
ResolveRecoveryConflictWithVirtualXIDs(temp_file_users,
|
||||
PROCSIG_RECOVERY_CONFLICT_TABLESPACE);
|
||||
PROCSIG_RECOVERY_CONFLICT_TABLESPACE);
|
||||
}
|
||||
|
||||
void
|
||||
@ -376,7 +376,7 @@ ResolveRecoveryConflictWithLock(LOCKTAG locktag)
|
||||
|
||||
backends = GetLockConflicts(&locktag, AccessExclusiveLock);
|
||||
ResolveRecoveryConflictWithVirtualXIDs(backends,
|
||||
PROCSIG_RECOVERY_CONFLICT_LOCK);
|
||||
PROCSIG_RECOVERY_CONFLICT_LOCK);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -529,7 +529,7 @@ CheckRecoveryConflictDeadlock(void)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_T_R_DEADLOCK_DETECTED),
|
||||
errmsg("canceling statement due to conflict with recovery"),
|
||||
errdetail("User transaction caused buffer deadlock with recovery.")));
|
||||
errdetail("User transaction caused buffer deadlock with recovery.")));
|
||||
}
|
||||
|
||||
|
||||
@ -986,7 +986,7 @@ LogCurrentRunningXacts(RunningTransactions CurrRunningXacts)
|
||||
/* array of TransactionIds */
|
||||
if (xlrec.xcnt > 0)
|
||||
XLogRegisterData((char *) CurrRunningXacts->xids,
|
||||
(xlrec.xcnt + xlrec.subxcnt) * sizeof(TransactionId));
|
||||
(xlrec.xcnt + xlrec.subxcnt) * sizeof(TransactionId));
|
||||
|
||||
recptr = XLogInsert(RM_STANDBY_ID, XLOG_RUNNING_XACTS);
|
||||
|
||||
|
Reference in New Issue
Block a user