Initial pgindent and pgperltidy run for v14.

Also "make reformat-dat-files".

The only change worthy of note is that pgindent messed up the formatting
of launcher.c's struct LogicalRepWorkerId, which led me to notice that
that struct wasn't used at all anymore, so I just took it out.
This commit is contained in:
Tom Lane 2021-05-12 13:14:10 -04:00
parent e6ccd1ce16
commit def5b065ff
230 changed files with 2408 additions and 2125 deletions

View File

@ -51,8 +51,7 @@ detects_heap_corruption(
#
fresh_test_table('test');
$node->safe_psql('postgres', q(VACUUM (FREEZE, DISABLE_PAGE_SKIPPING) test));
detects_no_corruption(
"verify_heapam('test')",
detects_no_corruption("verify_heapam('test')",
"all-frozen not corrupted table");
corrupt_first_page('test');
detects_heap_corruption("verify_heapam('test')",

View File

@ -839,13 +839,16 @@ check_tuple_visibility(HeapCheckContext *ctx)
return false;
case XID_COMMITTED:
/*
* The tuple is dead, because the xvac transaction moved
* it off and committed. It's checkable, but also prunable.
* it off and committed. It's checkable, but also
* prunable.
*/
return true;
case XID_ABORTED:
/*
* The original xmin must have committed, because the xvac
* transaction tried to move it later. Since xvac is
@ -905,6 +908,7 @@ check_tuple_visibility(HeapCheckContext *ctx)
return false;
case XID_COMMITTED:
/*
* The original xmin must have committed, because the xvac
* transaction moved it later. Whether it's still alive
@ -913,9 +917,11 @@ check_tuple_visibility(HeapCheckContext *ctx)
break;
case XID_ABORTED:
/*
* The tuple is dead, because the xvac transaction moved
* it off and committed. It's checkable, but also prunable.
* it off and committed. It's checkable, but also
* prunable.
*/
return true;
}
@ -924,12 +930,12 @@ check_tuple_visibility(HeapCheckContext *ctx)
{
/*
* Inserting transaction is not in progress, and not committed, so
* it might have changed the TupleDesc in ways we don't know about.
* Thus, don't try to check the tuple structure.
* it might have changed the TupleDesc in ways we don't know
* about. Thus, don't try to check the tuple structure.
*
* If xmin_status happens to be XID_IS_CURRENT_XID, then in theory
* any such DDL changes ought to be visible to us, so perhaps
* we could check anyway in that case. But, for now, let's be
* any such DDL changes ought to be visible to us, so perhaps we
* could check anyway in that case. But, for now, let's be
* conservative and treat this like any other uncommitted insert.
*/
return false;
@ -945,18 +951,19 @@ check_tuple_visibility(HeapCheckContext *ctx)
{
/*
* xmax is a multixact, so sanity-check the MXID. Note that we do this
* prior to checking for HEAP_XMAX_INVALID or HEAP_XMAX_IS_LOCKED_ONLY.
* This might therefore complain about things that wouldn't actually
* be a problem during a normal scan, but eventually we're going to
* have to freeze, and that process will ignore hint bits.
* prior to checking for HEAP_XMAX_INVALID or
* HEAP_XMAX_IS_LOCKED_ONLY. This might therefore complain about
* things that wouldn't actually be a problem during a normal scan,
* but eventually we're going to have to freeze, and that process will
* ignore hint bits.
*
* Even if the MXID is out of range, we still know that the original
* insert committed, so we can check the tuple itself. However, we
* can't rule out the possibility that this tuple is dead, so don't
* clear ctx->tuple_could_be_pruned. Possibly we should go ahead and
* clear that flag anyway if HEAP_XMAX_INVALID is set or if
* HEAP_XMAX_IS_LOCKED_ONLY is true, but for now we err on the side
* of avoiding possibly-bogus complaints about missing TOAST entries.
* HEAP_XMAX_IS_LOCKED_ONLY is true, but for now we err on the side of
* avoiding possibly-bogus complaints about missing TOAST entries.
*/
xmax = HeapTupleHeaderGetRawXmax(tuphdr);
switch (check_mxid_valid_in_rel(xmax, ctx))
@ -1066,9 +1073,10 @@ check_tuple_visibility(HeapCheckContext *ctx)
* away depends on how old the deleting transaction is.
*/
ctx->tuple_could_be_pruned = TransactionIdPrecedes(xmax,
ctx->safe_xmin);
ctx->safe_xmin);
break;
case XID_ABORTED:
/*
* The delete aborted or crashed. The tuple is still live.
*/
@ -1127,15 +1135,17 @@ check_tuple_visibility(HeapCheckContext *ctx)
break;
case XID_COMMITTED:
/*
* The delete committed. Whether the toast can be vacuumed away
* depends on how old the deleting transaction is.
*/
ctx->tuple_could_be_pruned = TransactionIdPrecedes(xmax,
ctx->safe_xmin);
ctx->safe_xmin);
break;
case XID_ABORTED:
/*
* The delete aborted or crashed. The tuple is still live.
*/
@ -1248,6 +1258,7 @@ check_toast_tuple(HeapTuple toasttup, HeapCheckContext *ctx,
ta->toast_pointer.va_valueid,
chunk_seq, chunksize, expected_size));
}
/*
* Check the current attribute as tracked in ctx, recording any corruption
* found in ctx->tupstore.

View File

@ -536,7 +536,7 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
ereport(DEBUG1,
(errcode(ERRCODE_NO_DATA),
errmsg_internal("harmless fast root mismatch in index \"%s\"",
RelationGetRelationName(rel)),
RelationGetRelationName(rel)),
errdetail_internal("Fast root block %u (level %u) differs from true root block %u (level %u).",
metad->btm_fastroot, metad->btm_fastlevel,
metad->btm_root, metad->btm_level)));
@ -722,7 +722,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
ereport(DEBUG1,
(errcode(ERRCODE_NO_DATA),
errmsg_internal("block %u of index \"%s\" concurrently deleted",
current, RelationGetRelationName(state->rel))));
current, RelationGetRelationName(state->rel))));
goto nextpage;
}
else if (nextleveldown.leftmost == InvalidBlockNumber)
@ -918,7 +918,7 @@ bt_recheck_sibling_links(BtreeCheckState *state,
Buffer newtargetbuf;
Page page;
BTPageOpaque opaque;
BlockNumber newtargetblock;
BlockNumber newtargetblock;
/* Couple locks in the usual order for nbtree: Left to right */
lbuf = ReadBufferExtended(state->rel, MAIN_FORKNUM, leftcurrent,
@ -980,7 +980,7 @@ bt_recheck_sibling_links(BtreeCheckState *state,
ereport(DEBUG1,
(errcode(ERRCODE_INTERNAL_ERROR),
errmsg_internal("harmless concurrent page split detected in index \"%s\"",
RelationGetRelationName(state->rel)),
RelationGetRelationName(state->rel)),
errdetail_internal("Block=%u new right sibling=%u original right sibling=%u.",
leftcurrent, newtargetblock,
state->targetblock)));
@ -1599,7 +1599,7 @@ bt_right_page_check_scankey(BtreeCheckState *state)
ereport(DEBUG2,
(errcode(ERRCODE_NO_DATA),
errmsg_internal("level %u sibling page in block %u of index \"%s\" was found deleted or half dead",
opaque->btpo_level, targetnext, RelationGetRelationName(state->rel)),
opaque->btpo_level, targetnext, RelationGetRelationName(state->rel)),
errdetail_internal("Deleted page found when building scankey from right sibling.")));
targetnext = opaque->btpo_next;
@ -1729,8 +1729,8 @@ bt_right_page_check_scankey(BtreeCheckState *state)
ereport(DEBUG2,
(errcode(ERRCODE_NO_DATA),
errmsg_internal("%s block %u of index \"%s\" has no first data item",
P_ISLEAF(opaque) ? "leaf" : "internal", targetnext,
RelationGetRelationName(state->rel))));
P_ISLEAF(opaque) ? "leaf" : "internal", targetnext,
RelationGetRelationName(state->rel))));
return NULL;
}
@ -2278,7 +2278,7 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
ereport(DEBUG1,
(errcode(ERRCODE_NO_DATA),
errmsg_internal("harmless interrupted page split detected in index \"%s\"",
RelationGetRelationName(state->rel)),
RelationGetRelationName(state->rel)),
errdetail_internal("Block=%u level=%u left sibling=%u page lsn=%X/%X.",
blkno, opaque->btpo_level,
opaque->btpo_prev,

View File

@ -25,11 +25,11 @@
*/
typedef struct
{
int current_index;
int head_offset;
TimestampTz head_timestamp;
int count_used;
TransactionId xid_by_minute[FLEXIBLE_ARRAY_MEMBER];
int current_index;
int head_offset;
TimestampTz head_timestamp;
int count_used;
TransactionId xid_by_minute[FLEXIBLE_ARRAY_MEMBER];
} OldSnapshotTimeMapping;
#define NUM_TIME_MAPPING_COLUMNS 3
@ -53,7 +53,7 @@ pg_old_snapshot_time_mapping(PG_FUNCTION_ARGS)
if (SRF_IS_FIRSTCALL())
{
MemoryContext oldcontext;
MemoryContext oldcontext;
funcctx = SRF_FIRSTCALL_INIT();
oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
@ -127,24 +127,25 @@ MakeOldSnapshotTimeMappingTupleDesc(void)
static HeapTuple
MakeOldSnapshotTimeMappingTuple(TupleDesc tupdesc, OldSnapshotTimeMapping *mapping)
{
Datum values[NUM_TIME_MAPPING_COLUMNS];
bool nulls[NUM_TIME_MAPPING_COLUMNS];
int array_position;
TimestampTz timestamp;
Datum values[NUM_TIME_MAPPING_COLUMNS];
bool nulls[NUM_TIME_MAPPING_COLUMNS];
int array_position;
TimestampTz timestamp;
/*
* Figure out the array position corresponding to the current index.
*
* Index 0 means the oldest entry in the mapping, which is stored at
* mapping->head_offset. Index 1 means the next-oldest entry, which is a the
* following index, and so on. We wrap around when we reach the end of the array.
* mapping->head_offset. Index 1 means the next-oldest entry, which is a
* the following index, and so on. We wrap around when we reach the end of
* the array.
*/
array_position = (mapping->head_offset + mapping->current_index)
% OLD_SNAPSHOT_TIME_MAP_ENTRIES;
/*
* No explicit timestamp is stored for any entry other than the oldest one,
* but each entry corresponds to 1-minute period, so we can just add.
* No explicit timestamp is stored for any entry other than the oldest
* one, but each entry corresponds to 1-minute period, so we can just add.
*/
timestamp = TimestampTzPlusMilliseconds(mapping->head_timestamp,
mapping->current_index * 60000);

View File

@ -1074,9 +1074,10 @@ pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
* Force utility statements to get queryId zero. We do this even in cases
* where the statement contains an optimizable statement for which a
* queryId could be derived (such as EXPLAIN or DECLARE CURSOR). For such
* cases, runtime control will first go through ProcessUtility and then the
* executor, and we don't want the executor hooks to do anything, since we
* are already measuring the statement's costs at the utility level.
* cases, runtime control will first go through ProcessUtility and then
* the executor, and we don't want the executor hooks to do anything,
* since we are already measuring the statement's costs at the utility
* level.
*
* Note that this is only done if pg_stat_statements is enabled and
* configured to track utility statements, in the unlikely possibility

View File

@ -1779,7 +1779,8 @@ rebuildInsertSql(StringInfo buf, char *orig_query,
int values_end_len, int num_cols,
int num_rows)
{
int i, j;
int i,
j;
int pindex;
bool first;
@ -1790,8 +1791,8 @@ rebuildInsertSql(StringInfo buf, char *orig_query,
appendBinaryStringInfo(buf, orig_query, values_end_len);
/*
* Add records to VALUES clause (we already have parameters for the
* first row, so start at the right offset).
* Add records to VALUES clause (we already have parameters for the first
* row, so start at the right offset).
*/
pindex = num_cols + 1;
for (i = 0; i < num_rows; i++)

View File

@ -146,7 +146,7 @@ typedef struct PgFdwScanState
/* for remote query execution */
PGconn *conn; /* connection for the scan */
PgFdwConnState *conn_state; /* extra per-connection state */
PgFdwConnState *conn_state; /* extra per-connection state */
unsigned int cursor_number; /* quasi-unique ID for my cursor */
bool cursor_exists; /* have we created the cursor? */
int numParams; /* number of parameters passed to query */
@ -164,7 +164,7 @@ typedef struct PgFdwScanState
bool eof_reached; /* true if last fetch reached EOF */
/* for asynchronous execution */
bool async_capable; /* engage asynchronous-capable logic? */
bool async_capable; /* engage asynchronous-capable logic? */
/* working memory contexts */
MemoryContext batch_cxt; /* context holding current batch of tuples */
@ -183,7 +183,7 @@ typedef struct PgFdwModifyState
/* for remote query execution */
PGconn *conn; /* connection for the scan */
PgFdwConnState *conn_state; /* extra per-connection state */
PgFdwConnState *conn_state; /* extra per-connection state */
char *p_name; /* name of prepared statement, if created */
/* extracted fdw_private data */
@ -227,7 +227,7 @@ typedef struct PgFdwDirectModifyState
/* for remote query execution */
PGconn *conn; /* connection for the update */
PgFdwConnState *conn_state; /* extra per-connection state */
PgFdwConnState *conn_state; /* extra per-connection state */
int numParams; /* number of parameters passed to query */
FmgrInfo *param_flinfo; /* output conversion functions for them */
List *param_exprs; /* executable expressions for param values */
@ -364,10 +364,10 @@ static TupleTableSlot *postgresExecForeignInsert(EState *estate,
TupleTableSlot *slot,
TupleTableSlot *planSlot);
static TupleTableSlot **postgresExecForeignBatchInsert(EState *estate,
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int *numSlots);
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int *numSlots);
static int postgresGetForeignModifyBatchSize(ResultRelInfo *resultRelInfo);
static TupleTableSlot *postgresExecForeignUpdate(EState *estate,
ResultRelInfo *resultRelInfo,
@ -467,11 +467,11 @@ static PgFdwModifyState *create_foreign_modify(EState *estate,
bool has_returning,
List *retrieved_attrs);
static TupleTableSlot **execute_foreign_modify(EState *estate,
ResultRelInfo *resultRelInfo,
CmdType operation,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int *numSlots);
ResultRelInfo *resultRelInfo,
CmdType operation,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int *numSlots);
static void prepare_foreign_modify(PgFdwModifyState *fmstate);
static const char **convert_prep_stmt_params(PgFdwModifyState *fmstate,
ItemPointer tupleid,
@ -545,7 +545,7 @@ static void apply_table_options(PgFdwRelationInfo *fpinfo);
static void merge_fdw_options(PgFdwRelationInfo *fpinfo,
const PgFdwRelationInfo *fpinfo_o,
const PgFdwRelationInfo *fpinfo_i);
static int get_batch_size_option(Relation rel);
static int get_batch_size_option(Relation rel);
/*
@ -1870,7 +1870,7 @@ postgresBeginForeignModify(ModifyTableState *mtstate,
target_attrs = (List *) list_nth(fdw_private,
FdwModifyPrivateTargetAttnums);
values_end_len = intVal(list_nth(fdw_private,
FdwModifyPrivateLen));
FdwModifyPrivateLen));
has_returning = intVal(list_nth(fdw_private,
FdwModifyPrivateHasReturning));
retrieved_attrs = (List *) list_nth(fdw_private,
@ -1907,7 +1907,7 @@ postgresExecForeignInsert(EState *estate,
{
PgFdwModifyState *fmstate = (PgFdwModifyState *) resultRelInfo->ri_FdwState;
TupleTableSlot **rslot;
int numSlots = 1;
int numSlots = 1;
/*
* If the fmstate has aux_fmstate set, use the aux_fmstate (see
@ -1930,10 +1930,10 @@ postgresExecForeignInsert(EState *estate,
*/
static TupleTableSlot **
postgresExecForeignBatchInsert(EState *estate,
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int *numSlots)
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int *numSlots)
{
PgFdwModifyState *fmstate = (PgFdwModifyState *) resultRelInfo->ri_FdwState;
TupleTableSlot **rslot;
@ -1964,17 +1964,17 @@ postgresExecForeignBatchInsert(EState *estate,
static int
postgresGetForeignModifyBatchSize(ResultRelInfo *resultRelInfo)
{
int batch_size;
int batch_size;
PgFdwModifyState *fmstate = resultRelInfo->ri_FdwState ?
(PgFdwModifyState *) resultRelInfo->ri_FdwState :
NULL;
(PgFdwModifyState *) resultRelInfo->ri_FdwState :
NULL;
/* should be called only once */
Assert(resultRelInfo->ri_BatchSize == 0);
/*
* Should never get called when the insert is being performed as part of
* a row movement operation.
* Should never get called when the insert is being performed as part of a
* row movement operation.
*/
Assert(fmstate == NULL || fmstate->aux_fmstate == NULL);
@ -2009,10 +2009,10 @@ postgresExecForeignUpdate(EState *estate,
TupleTableSlot *planSlot)
{
TupleTableSlot **rslot;
int numSlots = 1;
int numSlots = 1;
rslot = execute_foreign_modify(estate, resultRelInfo, CMD_UPDATE,
&slot, &planSlot, &numSlots);
&slot, &planSlot, &numSlots);
return rslot ? rslot[0] : NULL;
}
@ -2028,10 +2028,10 @@ postgresExecForeignDelete(EState *estate,
TupleTableSlot *planSlot)
{
TupleTableSlot **rslot;
int numSlots = 1;
int numSlots = 1;
rslot = execute_foreign_modify(estate, resultRelInfo, CMD_DELETE,
&slot, &planSlot, &numSlots);
&slot, &planSlot, &numSlots);
return rslot ? rslot[0] : NULL;
}
@ -2117,13 +2117,13 @@ postgresBeginForeignInsert(ModifyTableState *mtstate,
/*
* If the foreign table is a partition that doesn't have a corresponding
* RTE entry, we need to create a new RTE
* describing the foreign table for use by deparseInsertSql and
* create_foreign_modify() below, after first copying the parent's RTE and
* modifying some fields to describe the foreign partition to work on.
* However, if this is invoked by UPDATE, the existing RTE may already
* correspond to this partition if it is one of the UPDATE subplan target
* rels; in that case, we can just use the existing RTE as-is.
* RTE entry, we need to create a new RTE describing the foreign table for
* use by deparseInsertSql and create_foreign_modify() below, after first
* copying the parent's RTE and modifying some fields to describe the
* foreign partition to work on. However, if this is invoked by UPDATE,
* the existing RTE may already correspond to this partition if it is one
* of the UPDATE subplan target rels; in that case, we can just use the
* existing RTE as-is.
*/
if (resultRelInfo->ri_RangeTableIndex == 0)
{
@ -2847,8 +2847,8 @@ postgresExplainForeignModify(ModifyTableState *mtstate,
ExplainPropertyText("Remote SQL", sql, es);
/*
* For INSERT we should always have batch size >= 1, but UPDATE
* and DELETE don't support batching so don't show the property.
* For INSERT we should always have batch size >= 1, but UPDATE and
* DELETE don't support batching so don't show the property.
*/
if (rinfo->ri_BatchSize > 0)
ExplainPropertyInteger("Batch Size", NULL, rinfo->ri_BatchSize, es);
@ -7255,18 +7255,18 @@ find_em_expr_for_input_target(PlannerInfo *root,
static int
get_batch_size_option(Relation rel)
{
Oid foreigntableid = RelationGetRelid(rel);
Oid foreigntableid = RelationGetRelid(rel);
ForeignTable *table;
ForeignServer *server;
List *options;
ListCell *lc;
/* we use 1 by default, which means "no batching" */
int batch_size = 1;
int batch_size = 1;
/*
* Load options for table and server. We append server options after
* table options, because table options take precedence.
* Load options for table and server. We append server options after table
* options, because table options take precedence.
*/
table = GetForeignTable(foreigntableid);
server = GetForeignServer(table->serverid);

View File

@ -645,11 +645,11 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
* range values; if so, have the pages in the range added
* to the output bitmap.
*
* The opclass may or may not support processing of multiple
* scan keys. We can determine that based on the number of
* arguments - functions with extra parameter (number of scan
* keys) do support this, otherwise we have to simply pass the
* scan keys one by one.
* The opclass may or may not support processing of
* multiple scan keys. We can determine that based on the
* number of arguments - functions with extra parameter
* (number of scan keys) do support this, otherwise we
* have to simply pass the scan keys one by one.
*/
if (consistentFn[attno - 1].fn_nargs >= 4)
{
@ -667,10 +667,10 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
/*
* Check keys one by one
*
* When there are multiple scan keys, failure to meet the
* criteria for a single one of them is enough to discard
* the range as a whole, so break out of the loop as soon
* as a false return value is obtained.
* When there are multiple scan keys, failure to meet
* the criteria for a single one of them is enough to
* discard the range as a whole, so break out of the
* loop as soon as a false return value is obtained.
*/
int keyno;

View File

@ -258,7 +258,7 @@ typedef struct BloomFilter
/* data of the bloom filter */
char data[FLEXIBLE_ARRAY_MEMBER];
} BloomFilter;
} BloomFilter;
/*
@ -341,7 +341,7 @@ bloom_init(int ndistinct, double false_positive_rate)
* Add value to the bloom filter.
*/
static BloomFilter *
bloom_add_value(BloomFilter * filter, uint32 value, bool *updated)
bloom_add_value(BloomFilter *filter, uint32 value, bool *updated)
{
int i;
uint64 h1,
@ -378,7 +378,7 @@ bloom_add_value(BloomFilter * filter, uint32 value, bool *updated)
* Check if the bloom filter contains a particular value.
*/
static bool
bloom_contains_value(BloomFilter * filter, uint32 value)
bloom_contains_value(BloomFilter *filter, uint32 value)
{
int i;
uint64 h1,
@ -414,7 +414,7 @@ typedef struct BloomOpaque
*/
FmgrInfo extra_procinfos[BLOOM_MAX_PROCNUMS];
bool extra_proc_missing[BLOOM_MAX_PROCNUMS];
} BloomOpaque;
} BloomOpaque;
static FmgrInfo *bloom_get_procinfo(BrinDesc *bdesc, uint16 attno,
uint16 procnum);

View File

@ -114,7 +114,7 @@ typedef struct MinmaxMultiOpaque
bool extra_proc_missing[MINMAX_MAX_PROCNUMS];
Oid cached_subtype;
FmgrInfo strategy_procinfos[BTMaxStrategyNumber];
} MinmaxMultiOpaque;
} MinmaxMultiOpaque;
/*
* Storage type for BRIN's minmax reloptions
@ -261,7 +261,7 @@ typedef struct compare_context
{
FmgrInfo *cmpFn;
Oid colloid;
} compare_context;
} compare_context;
static int compare_values(const void *a, const void *b, void *arg);
@ -670,11 +670,11 @@ range_serialize(Ranges *range)
/*
* For values passed by value, we need to copy just the
* significant bytes - we can't use memcpy directly, as that
* assumes little endian behavior. store_att_byval does
* almost what we need, but it requires properly aligned
* buffer - the output buffer does not guarantee that. So we
* simply use a local Datum variable (which guarantees proper
* alignment), and then copy the value from it.
* assumes little endian behavior. store_att_byval does almost
* what we need, but it requires properly aligned buffer - the
* output buffer does not guarantee that. So we simply use a local
* Datum variable (which guarantees proper alignment), and then
* copy the value from it.
*/
store_att_byval(&tmp, range->values[i], typlen);
@ -771,7 +771,7 @@ range_deserialize(int maxvalues, SerializedRanges *serialized)
dataptr = NULL;
for (i = 0; (i < nvalues) && (!typbyval); i++)
{
if (typlen > 0) /* fixed-length by-ref types */
if (typlen > 0) /* fixed-length by-ref types */
datalen += MAXALIGN(typlen);
else if (typlen == -1) /* varlena */
{
@ -824,7 +824,8 @@ range_deserialize(int maxvalues, SerializedRanges *serialized)
}
else if (typlen == -2) /* cstring */
{
Size slen = strlen(ptr) + 1;
Size slen = strlen(ptr) + 1;
range->values[i] = PointerGetDatum(dataptr);
memcpy(dataptr, ptr, slen);
@ -2156,8 +2157,8 @@ brin_minmax_multi_distance_interval(PG_FUNCTION_ARGS)
/*
* Delta is (fractional) number of days between the intervals. Assume
* months have 30 days for consistency with interval_cmp_internal.
* We don't need to be exact, in the worst case we'll build a bit less
* months have 30 days for consistency with interval_cmp_internal. We
* don't need to be exact, in the worst case we'll build a bit less
* efficient ranges. But we should not contradict interval_cmp.
*/
dayfraction = result->time % USECS_PER_DAY;
@ -2315,13 +2316,12 @@ brin_minmax_multi_distance_inet(PG_FUNCTION_ARGS)
/*
* The length is calculated from the mask length, because we sort the
* addresses by first address in the range, so A.B.C.D/24 < A.B.C.1
* (the first range starts at A.B.C.0, which is before A.B.C.1). We
* don't want to produce negative delta in this case, so we just cut
* the extra bytes.
* addresses by first address in the range, so A.B.C.D/24 < A.B.C.1 (the
* first range starts at A.B.C.0, which is before A.B.C.1). We don't want
* to produce negative delta in this case, so we just cut the extra bytes.
*
* XXX Maybe this should be a bit more careful and cut the bits, not
* just whole bytes.
* XXX Maybe this should be a bit more careful and cut the bits, not just
* whole bytes.
*/
lena = ip_bits(ipa);
lenb = ip_bits(ipb);
@ -2331,8 +2331,8 @@ brin_minmax_multi_distance_inet(PG_FUNCTION_ARGS)
/* apply the network mask to both addresses */
for (i = 0; i < len; i++)
{
unsigned char mask;
int nbits;
unsigned char mask;
int nbits;
nbits = lena - (i * 8);
if (nbits < 8)

View File

@ -371,6 +371,7 @@ brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
regBuf = ReadBuffer(idxrel, ItemPointerGetBlockNumber(iptr));
LockBuffer(regBuf, BUFFER_LOCK_EXCLUSIVE);
regPg = BufferGetPage(regBuf);
/*
* We're only removing data, not reading it, so there's no need to
* TestForOldSnapshot here.

View File

@ -177,15 +177,15 @@ brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple,
datumno < brdesc->bd_info[keyno]->oi_nstored;
datumno++)
{
Datum value = tuple->bt_columns[keyno].bv_values[datumno];
Datum value = tuple->bt_columns[keyno].bv_values[datumno];
#ifdef TOAST_INDEX_HACK
/* We must look at the stored type, not at the index descriptor. */
TypeCacheEntry *atttype = brdesc->bd_info[keyno]->oi_typcache[datumno];
TypeCacheEntry *atttype = brdesc->bd_info[keyno]->oi_typcache[datumno];
/* Do we need to free the value at the end? */
bool free_value = false;
bool free_value = false;
/* For non-varlena types we don't need to do anything special */
if (atttype->typlen != -1)
@ -201,9 +201,9 @@ brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple,
* If value is stored EXTERNAL, must fetch it so we are not
* depending on outside storage.
*
* XXX Is this actually true? Could it be that the summary is
* NULL even for range with non-NULL data? E.g. degenerate bloom
* filter may be thrown away, etc.
* XXX Is this actually true? Could it be that the summary is NULL
* even for range with non-NULL data? E.g. degenerate bloom filter
* may be thrown away, etc.
*/
if (VARATT_IS_EXTERNAL(DatumGetPointer(value)))
{
@ -213,16 +213,16 @@ brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple,
}
/*
* If value is above size target, and is of a compressible datatype,
* try to compress it in-line.
* If value is above size target, and is of a compressible
* datatype, try to compress it in-line.
*/
if (!VARATT_IS_EXTENDED(DatumGetPointer(value)) &&
VARSIZE(DatumGetPointer(value)) > TOAST_INDEX_TARGET &&
(atttype->typstorage == TYPSTORAGE_EXTENDED ||
atttype->typstorage == TYPSTORAGE_MAIN))
{
Datum cvalue;
char compression;
Datum cvalue;
char compression;
Form_pg_attribute att = TupleDescAttr(brdesc->bd_tupdesc,
keyno);

View File

@ -103,14 +103,14 @@ index_form_tuple(TupleDesc tupleDescriptor,
(att->attstorage == TYPSTORAGE_EXTENDED ||
att->attstorage == TYPSTORAGE_MAIN))
{
Datum cvalue;
char compression = att->attcompression;
Datum cvalue;
char compression = att->attcompression;
/*
* If the compression method is not valid, use the default. We
* don't expect this to happen for regular index columns, which
* inherit the setting from the corresponding table column, but
* we do expect it to happen whenever an expression is indexed.
* inherit the setting from the corresponding table column, but we
* do expect it to happen whenever an expression is indexed.
*/
if (!CompressionMethodIsValid(compression))
compression = GetDefaultToastCompression();

View File

@ -24,7 +24,7 @@
#include "utils/builtins.h"
/* GUC */
int default_toast_compression = TOAST_PGLZ_COMPRESSION;
int default_toast_compression = TOAST_PGLZ_COMPRESSION;
#define NO_LZ4_SUPPORT() \
ereport(ERROR, \
@ -109,7 +109,7 @@ pglz_decompress_datum(const struct varlena *value)
*/
struct varlena *
pglz_decompress_datum_slice(const struct varlena *value,
int32 slicelength)
int32 slicelength)
{
struct varlena *result;
int32 rawsize;
@ -255,12 +255,12 @@ lz4_decompress_datum_slice(const struct varlena *value, int32 slicelength)
ToastCompressionId
toast_get_compression_id(struct varlena *attr)
{
ToastCompressionId cmid = TOAST_INVALID_COMPRESSION_ID;
ToastCompressionId cmid = TOAST_INVALID_COMPRESSION_ID;
/*
* If it is stored externally then fetch the compression method id from the
* external toast pointer. If compressed inline, fetch it from the toast
* compression header.
* If it is stored externally then fetch the compression method id from
* the external toast pointer. If compressed inline, fetch it from the
* toast compression header.
*/
if (VARATT_IS_EXTERNAL_ONDISK(attr))
{

View File

@ -48,7 +48,7 @@ toast_compress_datum(Datum value, char cmethod)
{
struct varlena *tmp = NULL;
int32 valsize;
ToastCompressionId cmid = TOAST_INVALID_COMPRESSION_ID;
ToastCompressionId cmid = TOAST_INVALID_COMPRESSION_ID;
Assert(!VARATT_IS_EXTERNAL(DatumGetPointer(value)));
Assert(!VARATT_IS_COMPRESSED(DatumGetPointer(value)));

View File

@ -236,7 +236,7 @@ execute_attr_map_slot(AttrMap *attrMap,
Bitmapset *
execute_attr_map_cols(AttrMap *attrMap, Bitmapset *in_cols)
{
Bitmapset *out_cols;
Bitmapset *out_cols;
int out_attnum;
/* fast path for the common trivial case */

View File

@ -35,9 +35,9 @@ static bool rtree_internal_consistent(BOX *key, BOX *query,
static uint64 point_zorder_internal(float4 x, float4 y);
static uint64 part_bits32_by2(uint32 x);
static uint32 ieee_float32_to_uint32(float f);
static int gist_bbox_zorder_cmp(Datum a, Datum b, SortSupport ssup);
static int gist_bbox_zorder_cmp(Datum a, Datum b, SortSupport ssup);
static Datum gist_bbox_zorder_abbrev_convert(Datum original, SortSupport ssup);
static int gist_bbox_zorder_cmp_abbrev(Datum z1, Datum z2, SortSupport ssup);
static int gist_bbox_zorder_cmp_abbrev(Datum z1, Datum z2, SortSupport ssup);
static bool gist_bbox_zorder_abbrev_abort(int memtupcount, SortSupport ssup);

View File

@ -267,7 +267,7 @@ gistvalidate(Oid opclassoid)
continue; /* got it */
if (i == GIST_DISTANCE_PROC || i == GIST_FETCH_PROC ||
i == GIST_COMPRESS_PROC || i == GIST_DECOMPRESS_PROC ||
i == GIST_OPTIONS_PROC || i == GIST_SORTSUPPORT_PROC)
i == GIST_OPTIONS_PROC || i == GIST_SORTSUPPORT_PROC)
continue; /* optional methods */
ereport(INFO,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),

View File

@ -432,11 +432,11 @@ heapgetpage(TableScanDesc sscan, BlockNumber page)
* transactions on the primary might still be invisible to a read-only
* transaction in the standby. We partly handle this problem by tracking
* the minimum xmin of visible tuples as the cut-off XID while marking a
* page all-visible on the primary and WAL log that along with the visibility
* map SET operation. In hot standby, we wait for (or abort) all
* transactions that can potentially may not see one or more tuples on the
* page. That's how index-only scans work fine in hot standby. A crucial
* difference between index-only scans and heap scans is that the
* page all-visible on the primary and WAL log that along with the
* visibility map SET operation. In hot standby, we wait for (or abort)
* all transactions that can potentially may not see one or more tuples on
* the page. That's how index-only scans work fine in hot standby. A
* crucial difference between index-only scans and heap scans is that the
* index-only scan completely relies on the visibility map where as heap
* scan looks at the page-level PD_ALL_VISIBLE flag. We are not sure if
* the page-level flag can be trusted in the same way, because it might
@ -2095,11 +2095,11 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
/*
* If we're inserting frozen entry into an empty page,
* set visibility map bits and PageAllVisible() hint.
* If we're inserting frozen entry into an empty page, set visibility map
* bits and PageAllVisible() hint.
*
* If we're inserting frozen entry into already all_frozen page,
* preserve this state.
* If we're inserting frozen entry into already all_frozen page, preserve
* this state.
*/
if (options & HEAP_INSERT_FROZEN)
{
@ -2109,7 +2109,7 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
if (visibilitymap_pin_ok(BufferGetBlockNumber(buffer), vmbuffer))
vmstatus = visibilitymap_get_status(relation,
BufferGetBlockNumber(buffer), &vmbuffer);
BufferGetBlockNumber(buffer), &vmbuffer);
if ((starting_with_empty_page || vmstatus & VISIBILITYMAP_ALL_FROZEN))
all_frozen_set = true;
@ -2139,8 +2139,8 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
(options & HEAP_INSERT_SPECULATIVE) != 0);
/*
* If the page is all visible, need to clear that, unless we're only
* going to add further frozen rows to it.
* If the page is all visible, need to clear that, unless we're only going
* to add further frozen rows to it.
*
* If we're only adding already frozen rows to a page that was empty or
* marked as all visible, mark it as all-visible.
@ -2258,11 +2258,11 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
END_CRIT_SECTION();
/*
* If we've frozen everything on the page, update the visibilitymap.
* We're already holding pin on the vmbuffer.
* If we've frozen everything on the page, update the visibilitymap. We're
* already holding pin on the vmbuffer.
*
* No need to update the visibilitymap if it had all_frozen bit set
* before this insertion.
* No need to update the visibilitymap if it had all_frozen bit set before
* this insertion.
*/
if (all_frozen_set && ((vmstatus & VISIBILITYMAP_ALL_FROZEN) == 0))
{
@ -2270,14 +2270,14 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
Assert(visibilitymap_pin_ok(BufferGetBlockNumber(buffer), vmbuffer));
/*
* It's fine to use InvalidTransactionId here - this is only used
* when HEAP_INSERT_FROZEN is specified, which intentionally
* violates visibility rules.
* It's fine to use InvalidTransactionId here - this is only used when
* HEAP_INSERT_FROZEN is specified, which intentionally violates
* visibility rules.
*/
visibilitymap_set(relation, BufferGetBlockNumber(buffer), buffer,
InvalidXLogRecPtr, vmbuffer,
InvalidTransactionId,
VISIBILITYMAP_ALL_VISIBLE | VISIBILITYMAP_ALL_FROZEN);
InvalidXLogRecPtr, vmbuffer,
InvalidTransactionId,
VISIBILITYMAP_ALL_VISIBLE | VISIBILITYMAP_ALL_FROZEN);
}
UnlockReleaseBuffer(buffer);
@ -2547,7 +2547,7 @@ heap_multi_insert(Relation relation, TupleTableSlot **slots, int ntuples,
tupledata = scratchptr;
/* check that the mutually exclusive flags are not both set */
Assert (!(all_visible_cleared && all_frozen_set));
Assert(!(all_visible_cleared && all_frozen_set));
xlrec->flags = 0;
if (all_visible_cleared)
@ -3063,7 +3063,10 @@ l1:
xl_heap_header xlhdr;
XLogRecPtr recptr;
/* For logical decode we need combo CIDs to properly decode the catalog */
/*
* For logical decode we need combo CIDs to properly decode the
* catalog
*/
if (RelationIsAccessibleInLogicalDecoding(relation))
log_heap_new_cid(relation, &tp);
@ -7932,16 +7935,16 @@ bottomup_sort_and_shrink(TM_IndexDeleteOp *delstate)
* TIDs as each other. The goal is to ignore relatively small differences
* in the total number of promising entries, so that the whole process can
* give a little weight to heapam factors (like heap block locality)
* instead. This isn't a trade-off, really -- we have nothing to lose.
* It would be foolish to interpret small differences in npromisingtids
* instead. This isn't a trade-off, really -- we have nothing to lose. It
* would be foolish to interpret small differences in npromisingtids
* values as anything more than noise.
*
* We tiebreak on nhtids when sorting block group subsets that have the
* same npromisingtids, but this has the same issues as npromisingtids,
* and so nhtids is subject to the same power-of-two bucketing scheme.
* The only reason that we don't fix nhtids in the same way here too is
* that we'll need accurate nhtids values after the sort. We handle
* nhtids bucketization dynamically instead (in the sort comparator).
* and so nhtids is subject to the same power-of-two bucketing scheme. The
* only reason that we don't fix nhtids in the same way here too is that
* we'll need accurate nhtids values after the sort. We handle nhtids
* bucketization dynamically instead (in the sort comparator).
*
* See bottomup_nblocksfavorable() for a full explanation of when and how
* heap locality/favorable blocks can significantly influence when and how
@ -8944,8 +8947,8 @@ heap_xlog_insert(XLogReaderState *record)
ItemPointerSetOffsetNumber(&target_tid, xlrec->offnum);
/* check that the mutually exclusive flags are not both set */
Assert (!((xlrec->flags & XLH_INSERT_ALL_VISIBLE_CLEARED) &&
(xlrec->flags & XLH_INSERT_ALL_FROZEN_SET)));
Assert(!((xlrec->flags & XLH_INSERT_ALL_VISIBLE_CLEARED) &&
(xlrec->flags & XLH_INSERT_ALL_FROZEN_SET)));
/*
* The visibility map may need to be fixed even if the heap page is
@ -9072,8 +9075,8 @@ heap_xlog_multi_insert(XLogReaderState *record)
XLogRecGetBlockTag(record, 0, &rnode, NULL, &blkno);
/* check that the mutually exclusive flags are not both set */
Assert (!((xlrec->flags & XLH_INSERT_ALL_VISIBLE_CLEARED) &&
(xlrec->flags & XLH_INSERT_ALL_FROZEN_SET)));
Assert(!((xlrec->flags & XLH_INSERT_ALL_VISIBLE_CLEARED) &&
(xlrec->flags & XLH_INSERT_ALL_FROZEN_SET)));
/*
* The visibility map may need to be fixed even if the heap page is

View File

@ -1659,13 +1659,13 @@ heapam_index_build_range_scan(Relation heapRelation,
offnum = ItemPointerGetOffsetNumber(&heapTuple->t_self);
/*
* If a HOT tuple points to a root that we don't know
* about, obtain root items afresh. If that still fails,
* report it as corruption.
* If a HOT tuple points to a root that we don't know about,
* obtain root items afresh. If that still fails, report it as
* corruption.
*/
if (root_offsets[offnum - 1] == InvalidOffsetNumber)
{
Page page = BufferGetPage(hscan->rs_cbuf);
Page page = BufferGetPage(hscan->rs_cbuf);
LockBuffer(hscan->rs_cbuf, BUFFER_LOCK_SHARE);
heap_get_root_tuples(page, root_offsets);
@ -2482,8 +2482,8 @@ reform_and_rewrite_tuple(HeapTuple tuple,
else if (!isnull[i] && TupleDescAttr(newTupDesc, i)->attlen == -1)
{
struct varlena *new_value;
ToastCompressionId cmid;
char cmethod;
ToastCompressionId cmid;
char cmethod;
new_value = (struct varlena *) DatumGetPointer(values[i]);
cmid = toast_get_compression_id(new_value);

View File

@ -1608,8 +1608,8 @@ HeapTupleSatisfiesHistoricMVCC(HeapTuple htup, Snapshot snapshot,
/*
* another transaction might have (tried to) delete this tuple or
* cmin/cmax was stored in a combo CID. So we need to lookup the actual
* values externally.
* cmin/cmax was stored in a combo CID. So we need to lookup the
* actual values externally.
*/
resolved = ResolveCminCmaxDuringDecoding(HistoricSnapshotGetTupleCids(), snapshot,
htup, buffer,
@ -1629,8 +1629,8 @@ HeapTupleSatisfiesHistoricMVCC(HeapTuple htup, Snapshot snapshot,
* elog inside ResolveCminCmaxDuringDecoding.
*
* XXX For the streaming case, we can track the largest combo CID
* assigned, and error out based on this (when unable to resolve
* combo CID below that observed maximum value).
* assigned, and error out based on this (when unable to resolve combo
* CID below that observed maximum value).
*/
if (!resolved)
return false;
@ -1717,8 +1717,8 @@ HeapTupleSatisfiesHistoricMVCC(HeapTuple htup, Snapshot snapshot,
* elog inside ResolveCminCmaxDuringDecoding.
*
* XXX For the streaming case, we can track the largest combo CID
* assigned, and error out based on this (when unable to resolve
* combo CID below that observed maximum value).
* assigned, and error out based on this (when unable to resolve combo
* CID below that observed maximum value).
*/
if (!resolved || cmax == InvalidCommandId)
return true;

View File

@ -410,8 +410,8 @@ RelationGetBufferForTuple(Relation relation, Size len,
}
/*
* If the FSM knows nothing of the rel, try the last page before we
* give up and extend. This avoids one-tuple-per-page syndrome during
* If the FSM knows nothing of the rel, try the last page before we give
* up and extend. This avoids one-tuple-per-page syndrome during
* bootstrapping or in a recently-started system.
*/
if (targetBlock == InvalidBlockNumber)

View File

@ -95,8 +95,8 @@ heap_page_prune_opt(Relation relation, Buffer buffer)
/*
* We can't write WAL in recovery mode, so there's no point trying to
* clean the page. The primary will likely issue a cleaning WAL record soon
* anyway, so this is no particular loss.
* clean the page. The primary will likely issue a cleaning WAL record
* soon anyway, so this is no particular loss.
*/
if (RecoveryInProgress())
return;

View File

@ -691,8 +691,8 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
*
* Deliberately avoid telling the stats collector about LP_DEAD items that
* remain in the table due to VACUUM bypassing index and heap vacuuming.
* ANALYZE will consider the remaining LP_DEAD items to be dead tuples.
* It seems like a good idea to err on the side of not vacuuming again too
* ANALYZE will consider the remaining LP_DEAD items to be dead tuples. It
* seems like a good idea to err on the side of not vacuuming again too
* soon in cases where the failsafe prevented significant amounts of heap
* vacuuming.
*/
@ -2284,7 +2284,7 @@ static void
lazy_vacuum_heap_rel(LVRelState *vacrel)
{
int tupindex;
BlockNumber vacuumed_pages;
BlockNumber vacuumed_pages;
PGRUsage ru0;
Buffer vmbuffer = InvalidBuffer;
LVSavedErrInfo saved_err_info;

View File

@ -612,8 +612,8 @@ systable_endscan(SysScanDesc sysscan)
UnregisterSnapshot(sysscan->snapshot);
/*
* Reset the bsysscan flag at the end of the systable scan. See
* detailed comments in xact.c where these variables are declared.
* Reset the bsysscan flag at the end of the systable scan. See detailed
* comments in xact.c where these variables are declared.
*/
if (TransactionIdIsValid(CheckXidAlive))
bsysscan = false;

View File

@ -1054,22 +1054,22 @@ _bt_lockbuf(Relation rel, Buffer buf, int access)
LockBuffer(buf, access);
/*
* It doesn't matter that _bt_unlockbuf() won't get called in the
* event of an nbtree error (e.g. a unique violation error). That
* won't cause Valgrind false positives.
* It doesn't matter that _bt_unlockbuf() won't get called in the event of
* an nbtree error (e.g. a unique violation error). That won't cause
* Valgrind false positives.
*
* The nbtree client requests are superimposed on top of the
* bufmgr.c buffer pin client requests. In the event of an nbtree
* error the buffer will certainly get marked as defined when the
* backend once again acquires its first pin on the buffer. (Of
* course, if the backend never touches the buffer again then it
* doesn't matter that it remains non-accessible to Valgrind.)
* The nbtree client requests are superimposed on top of the bufmgr.c
* buffer pin client requests. In the event of an nbtree error the buffer
* will certainly get marked as defined when the backend once again
* acquires its first pin on the buffer. (Of course, if the backend never
* touches the buffer again then it doesn't matter that it remains
* non-accessible to Valgrind.)
*
* Note: When an IndexTuple C pointer gets computed using an
* ItemId read from a page while a lock was held, the C pointer
* becomes unsafe to dereference forever as soon as the lock is
* released. Valgrind can only detect cases where the pointer
* gets dereferenced with no _current_ lock/pin held, though.
* Note: When an IndexTuple C pointer gets computed using an ItemId read
* from a page while a lock was held, the C pointer becomes unsafe to
* dereference forever as soon as the lock is released. Valgrind can only
* detect cases where the pointer gets dereferenced with no _current_
* lock/pin held, though.
*/
if (!RelationUsesLocalBuffers(rel))
VALGRIND_MAKE_MEM_DEFINED(BufferGetPage(buf), BLCKSZ);
@ -2395,7 +2395,7 @@ _bt_unlink_halfdead_page(Relation rel, Buffer leafbuf, BlockNumber scanblkno,
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
while (P_ISDELETED(opaque) || opaque->btpo_next != target)
{
bool leftsibvalid = true;
bool leftsibvalid = true;
/*
* Before we follow the link from the page that was the left

View File

@ -898,8 +898,8 @@ btree_xlog_unlink_page(uint8 info, XLogReaderState *record)
* top parent link when deleting leafbuf because it's the last page
* we'll delete in the subtree undergoing deletion.
*/
Buffer leafbuf;
IndexTupleData trunctuple;
Buffer leafbuf;
IndexTupleData trunctuple;
Assert(!isleaf);

View File

@ -2278,7 +2278,7 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid,
/* Log the info */
ereport(DEBUG1,
(errmsg_internal("MultiXactId wrap limit is %u, limited by database with OID %u",
multiWrapLimit, oldest_datoid)));
multiWrapLimit, oldest_datoid)));
/*
* Computing the actual limits is only possible once the data directory is
@ -2612,7 +2612,7 @@ SetOffsetVacuumLimit(bool is_startup)
if (oldestOffsetKnown)
ereport(DEBUG1,
(errmsg_internal("oldest MultiXactId member is at offset %u",
oldestOffset)));
oldestOffset)));
else
ereport(LOG,
(errmsg("MultiXact member wraparound protections are disabled because oldest checkpointed MultiXact %u does not exist on disk",
@ -2641,7 +2641,7 @@ SetOffsetVacuumLimit(bool is_startup)
ereport(DEBUG1,
(errmsg_internal("MultiXact member stop limit is now %u based on MultiXact %u",
offsetStopLimit, oldestMultiXactId)));
offsetStopLimit, oldestMultiXactId)));
}
else if (prevOldestOffsetKnown)
{
@ -3283,9 +3283,9 @@ multixact_redo(XLogReaderState *record)
xlrec->moff + xlrec->nmembers);
/*
* Make sure nextXid is beyond any XID mentioned in the record.
* This should be unnecessary, since any XID found here ought to have
* other evidence in the XLOG, but let's be safe.
* Make sure nextXid is beyond any XID mentioned in the record. This
* should be unnecessary, since any XID found here ought to have other
* evidence in the XLOG, but let's be safe.
*/
max_xid = XLogRecGetXid(record);
for (i = 0; i < xlrec->nmembers; i++)

View File

@ -1134,9 +1134,9 @@ EndPrepare(GlobalTransaction gxact)
gxact->prepare_start_lsn = ProcLastRecPtr;
/*
* Mark the prepared transaction as valid. As soon as xact.c marks
* MyProc as not running our XID (which it will do immediately after
* this function returns), others can commit/rollback the xact.
* Mark the prepared transaction as valid. As soon as xact.c marks MyProc
* as not running our XID (which it will do immediately after this
* function returns), others can commit/rollback the xact.
*
* NB: a side effect of this is to make a dummy ProcArray entry for the
* prepared XID. This must happen before we clear the XID from MyProc /

View File

@ -179,10 +179,10 @@ GetNewTransactionId(bool isSubXact)
ExtendSUBTRANS(xid);
/*
* Now advance the nextXid counter. This must not happen until after
* we have successfully completed ExtendCLOG() --- if that routine fails,
* we want the next incoming transaction to try it again. We cannot
* assign more XIDs until there is CLOG space for them.
* Now advance the nextXid counter. This must not happen until after we
* have successfully completed ExtendCLOG() --- if that routine fails, we
* want the next incoming transaction to try it again. We cannot assign
* more XIDs until there is CLOG space for them.
*/
FullTransactionIdAdvance(&ShmemVariableCache->nextXid);
@ -192,8 +192,8 @@ GetNewTransactionId(bool isSubXact)
* latestCompletedXid is present in the ProcArray, which is essential for
* correct OldestXmin tracking; see src/backend/access/transam/README.
*
* Note that readers of ProcGlobal->xids/PGPROC->xid should be careful
* to fetch the value for each proc only once, rather than assume they can
* Note that readers of ProcGlobal->xids/PGPROC->xid should be careful to
* fetch the value for each proc only once, rather than assume they can
* read a value multiple times and get the same answer each time. Note we
* are assuming that TransactionId and int fetch/store are atomic.
*
@ -281,9 +281,9 @@ AdvanceNextFullTransactionIdPastXid(TransactionId xid)
uint32 epoch;
/*
* It is safe to read nextXid without a lock, because this is only
* called from the startup process or single-process mode, meaning that no
* other process can modify it.
* It is safe to read nextXid without a lock, because this is only called
* from the startup process or single-process mode, meaning that no other
* process can modify it.
*/
Assert(AmStartupProcess() || !IsUnderPostmaster);
@ -426,7 +426,7 @@ SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid)
/* Log the info */
ereport(DEBUG1,
(errmsg_internal("transaction ID wrap limit is %u, limited by database with OID %u",
xidWrapLimit, oldest_datoid)));
xidWrapLimit, oldest_datoid)));
/*
* If past the autovacuum force point, immediately signal an autovac
@ -617,8 +617,8 @@ AssertTransactionIdInAllowableRange(TransactionId xid)
* We can't acquire XidGenLock, as this may be called with XidGenLock
* already held (or with other locks that don't allow XidGenLock to be
* nested). That's ok for our purposes though, since we already rely on
* 32bit reads to be atomic. While nextXid is 64 bit, we only look at
* the lower 32bit, so a skewed read doesn't hurt.
* 32bit reads to be atomic. While nextXid is 64 bit, we only look at the
* lower 32bit, so a skewed read doesn't hurt.
*
* There's no increased danger of falling outside [oldest, next] by
* accessing them without a lock. xid needs to have been created with

View File

@ -723,7 +723,7 @@ typedef struct XLogCtlData
*/
TimestampTz currentChunkStartTime;
/* Recovery pause state */
RecoveryPauseState recoveryPauseState;
RecoveryPauseState recoveryPauseState;
ConditionVariable recoveryNotPausedCV;
/*
@ -2858,8 +2858,8 @@ UpdateMinRecoveryPoint(XLogRecPtr lsn, bool force)
ereport(DEBUG2,
(errmsg_internal("updated min recovery point to %X/%X on timeline %u",
LSN_FORMAT_ARGS(minRecoveryPoint),
newMinRecoveryPointTLI)));
LSN_FORMAT_ARGS(minRecoveryPoint),
newMinRecoveryPointTLI)));
}
}
LWLockRelease(ControlFileLock);
@ -3357,7 +3357,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
blocks = wal_segment_size / XLOG_BLCKSZ;
for (int i = 0; i < blocks;)
{
int iovcnt = Min(blocks - i, lengthof(iov));
int iovcnt = Min(blocks - i, lengthof(iov));
off_t offset = i * XLOG_BLCKSZ;
if (pg_pwritev_with_retry(fd, iov, iovcnt, offset) < 0)
@ -3814,8 +3814,8 @@ XLogFileReadAnyTLI(XLogSegNo segno, int emode, XLogSource source)
* however, unless we actually find a valid segment. That way if there is
* neither a timeline history file nor a WAL segment in the archive, and
* streaming replication is set up, we'll read the timeline history file
* streamed from the primary when we start streaming, instead of recovering
* with a dummy history generated here.
* streamed from the primary when we start streaming, instead of
* recovering with a dummy history generated here.
*/
if (expectedTLEs)
tles = expectedTLEs;
@ -4229,7 +4229,7 @@ RemoveXlogFile(const char *segname, XLogSegNo recycleSegNo,
{
ereport(DEBUG2,
(errmsg_internal("recycled write-ahead log file \"%s\"",
segname)));
segname)));
CheckpointStats.ckpt_segs_recycled++;
/* Needn't recheck that slot on future iterations */
(*endlogSegNo)++;
@ -4241,7 +4241,7 @@ RemoveXlogFile(const char *segname, XLogSegNo recycleSegNo,
ereport(DEBUG2,
(errmsg_internal("removing write-ahead log file \"%s\"",
segname)));
segname)));
#ifdef WIN32
@ -6093,7 +6093,7 @@ recoveryPausesHere(bool endOfRecovery)
RecoveryPauseState
GetRecoveryPauseState(void)
{
RecoveryPauseState state;
RecoveryPauseState state;
SpinLockAcquire(&XLogCtl->info_lck);
state = XLogCtl->recoveryPauseState;
@ -6347,7 +6347,11 @@ RecoveryRequiresIntParameter(const char *param_name, int currValue, int minValue
ereport(WARNING,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("promotion is not possible because of insufficient parameter settings"),
/* Repeat the detail from above so it's easy to find in the log. */
/*
* Repeat the detail from above so it's easy to find
* in the log.
*/
errdetail("%s = %d is a lower setting than on the primary server, where its value was %d.",
param_name,
currValue,
@ -6357,15 +6361,15 @@ RecoveryRequiresIntParameter(const char *param_name, int currValue, int minValue
}
/*
* If recovery pause is requested then set it paused. While we
* are in the loop, user might resume and pause again so set
* this every time.
* If recovery pause is requested then set it paused. While
* we are in the loop, user might resume and pause again so
* set this every time.
*/
ConfirmRecoveryPaused();
/*
* We wait on a condition variable that will wake us as soon as
* the pause ends, but we use a timeout so we can check the
* We wait on a condition variable that will wake us as soon
* as the pause ends, but we use a timeout so we can check the
* above conditions periodically too.
*/
ConditionVariableTimedSleep(&XLogCtl->recoveryNotPausedCV, 1000,
@ -6377,7 +6381,7 @@ RecoveryRequiresIntParameter(const char *param_name, int currValue, int minValue
ereport(FATAL,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("recovery aborted because of insufficient parameter settings"),
/* Repeat the detail from above so it's easy to find in the log. */
/* Repeat the detail from above so it's easy to find in the log. */
errdetail("%s = %d is a lower setting than on the primary server, where its value was %d.",
param_name,
currValue,
@ -6920,9 +6924,8 @@ StartupXLOG(void)
StartupReorderBuffer();
/*
* Startup CLOG. This must be done after ShmemVariableCache->nextXid
* has been initialized and before we accept connections or begin WAL
* replay.
* Startup CLOG. This must be done after ShmemVariableCache->nextXid has
* been initialized and before we accept connections or begin WAL replay.
*/
StartupCLOG();
@ -6969,11 +6972,11 @@ StartupXLOG(void)
* ourselves - the history file of the recovery target timeline covers all
* the previous timelines in the history too - a cascading standby server
* might be interested in them. Or, if you archive the WAL from this
* server to a different archive than the primary, it'd be good for all the
* history files to get archived there after failover, so that you can use
* one of the old timelines as a PITR target. Timeline history files are
* small, so it's better to copy them unnecessarily than not copy them and
* regret later.
* server to a different archive than the primary, it'd be good for all
* the history files to get archived there after failover, so that you can
* use one of the old timelines as a PITR target. Timeline history files
* are small, so it's better to copy them unnecessarily than not copy them
* and regret later.
*/
restoreTimeLineHistoryFiles(ThisTimeLineID, recoveryTargetTLI);
@ -7196,9 +7199,9 @@ StartupXLOG(void)
ProcArrayInitRecovery(XidFromFullTransactionId(ShmemVariableCache->nextXid));
/*
* Startup subtrans only. CLOG, MultiXact and commit
* timestamp have already been started up and other SLRUs are not
* maintained during recovery and need not be started yet.
* Startup subtrans only. CLOG, MultiXact and commit timestamp
* have already been started up and other SLRUs are not maintained
* during recovery and need not be started yet.
*/
StartupSUBTRANS(oldestActiveXID);
@ -7400,8 +7403,7 @@ StartupXLOG(void)
error_context_stack = &errcallback;
/*
* ShmemVariableCache->nextXid must be beyond record's
* xid.
* ShmemVariableCache->nextXid must be beyond record's xid.
*/
AdvanceNextFullTransactionIdPastXid(record->xl_xid);
@ -8092,10 +8094,10 @@ StartupXLOG(void)
WalSndWakeup();
/*
* If this was a promotion, request an (online) checkpoint now. This
* isn't required for consistency, but the last restartpoint might be far
* back, and in case of a crash, recovering from it might take a longer
* than is appropriate now that we're not in standby mode anymore.
* If this was a promotion, request an (online) checkpoint now. This isn't
* required for consistency, but the last restartpoint might be far back,
* and in case of a crash, recovering from it might take a longer than is
* appropriate now that we're not in standby mode anymore.
*/
if (promoted)
RequestCheckpoint(CHECKPOINT_FORCE);
@ -8674,7 +8676,7 @@ LogCheckpointStart(int flags, bool restartpoint)
{
if (restartpoint)
ereport(LOG,
/* translator: the placeholders show checkpoint options */
/* translator: the placeholders show checkpoint options */
(errmsg("restartpoint starting:%s%s%s%s%s%s%s%s",
(flags & CHECKPOINT_IS_SHUTDOWN) ? " shutdown" : "",
(flags & CHECKPOINT_END_OF_RECOVERY) ? " end-of-recovery" : "",
@ -8686,7 +8688,7 @@ LogCheckpointStart(int flags, bool restartpoint)
(flags & CHECKPOINT_FLUSH_ALL) ? " flush-all" : "")));
else
ereport(LOG,
/* translator: the placeholders show checkpoint options */
/* translator: the placeholders show checkpoint options */
(errmsg("checkpoint starting:%s%s%s%s%s%s%s%s",
(flags & CHECKPOINT_IS_SHUTDOWN) ? " shutdown" : "",
(flags & CHECKPOINT_END_OF_RECOVERY) ? " end-of-recovery" : "",
@ -11851,12 +11853,12 @@ read_backup_label(XLogRecPtr *checkPointLoc, bool *backupEndRequired,
if (fscanf(lfp, "START TIME: %127[^\n]\n", backuptime) == 1)
ereport(DEBUG1,
(errmsg_internal("backup time %s in file \"%s\"",
backuptime, BACKUP_LABEL_FILE)));
backuptime, BACKUP_LABEL_FILE)));
if (fscanf(lfp, "LABEL: %1023[^\n]\n", backuplabel) == 1)
ereport(DEBUG1,
(errmsg_internal("backup label %s in file \"%s\"",
backuplabel, BACKUP_LABEL_FILE)));
backuplabel, BACKUP_LABEL_FILE)));
/*
* START TIMELINE is new as of 11. Its parsing is not mandatory, still use
@ -11873,7 +11875,7 @@ read_backup_label(XLogRecPtr *checkPointLoc, bool *backupEndRequired,
ereport(DEBUG1,
(errmsg_internal("backup timeline %u in file \"%s\"",
tli_from_file, BACKUP_LABEL_FILE)));
tli_from_file, BACKUP_LABEL_FILE)));
}
if (ferror(lfp) || FreeFile(lfp))
@ -12177,8 +12179,8 @@ retry:
Assert(readFile != -1);
/*
* If the current segment is being streamed from the primary, calculate how
* much of the current page we have received already. We know the
* If the current segment is being streamed from the primary, calculate
* how much of the current page we have received already. We know the
* requested record has been received, but this is for the benefit of
* future calls, to allow quick exit at the top of this function.
*/
@ -12239,12 +12241,13 @@ retry:
* and replay reaches a record that's split across two WAL segments. The
* first page is only available locally, in pg_wal, because it's already
* been recycled on the primary. The second page, however, is not present
* in pg_wal, and we should stream it from the primary. There is a recycled
* WAL segment present in pg_wal, with garbage contents, however. We would
* read the first page from the local WAL segment, but when reading the
* second page, we would read the bogus, recycled, WAL segment. If we
* didn't catch that case here, we would never recover, because
* ReadRecord() would retry reading the whole record from the beginning.
* in pg_wal, and we should stream it from the primary. There is a
* recycled WAL segment present in pg_wal, with garbage contents, however.
* We would read the first page from the local WAL segment, but when
* reading the second page, we would read the bogus, recycled, WAL
* segment. If we didn't catch that case here, we would never recover,
* because ReadRecord() would retry reading the whole record from the
* beginning.
*
* Of course, this only catches errors in the page header, which is what
* happens in the case of a recycled WAL segment. Other kinds of errors or
@ -12399,15 +12402,15 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
* Failure while streaming. Most likely, we got here
* because streaming replication was terminated, or
* promotion was triggered. But we also get here if we
* find an invalid record in the WAL streamed from the primary,
* in which case something is seriously wrong. There's
* little chance that the problem will just go away, but
* PANIC is not good for availability either, especially
* in hot standby mode. So, we treat that the same as
* disconnection, and retry from archive/pg_wal again. The
* WAL in the archive should be identical to what was
* streamed, so it's unlikely that it helps, but one can
* hope...
* find an invalid record in the WAL streamed from the
* primary, in which case something is seriously wrong.
* There's little chance that the problem will just go
* away, but PANIC is not good for availability either,
* especially in hot standby mode. So, we treat that the
* same as disconnection, and retry from archive/pg_wal
* again. The WAL in the archive should be identical to
* what was streamed, so it's unlikely that it helps, but
* one can hope...
*/
/*

View File

@ -600,7 +600,7 @@ pg_is_wal_replay_paused(PG_FUNCTION_ARGS)
Datum
pg_get_wal_replay_pause_state(PG_FUNCTION_ARGS)
{
char *statestr = NULL;
char *statestr = NULL;
if (!RecoveryInProgress())
ereport(ERROR,
@ -609,7 +609,7 @@ pg_get_wal_replay_pause_state(PG_FUNCTION_ARGS)
errhint("Recovery control functions can only be executed during recovery.")));
/* get the recovery pause state */
switch(GetRecoveryPauseState())
switch (GetRecoveryPauseState())
{
case RECOVERY_NOT_PAUSED:
statestr = "not paused";

View File

@ -1065,8 +1065,8 @@ log_newpages(RelFileNode *rnode, ForkNumber forkNum, int num_pages,
for (j = batch_start; j < i; j++)
{
/*
* The page may be uninitialized. If so, we can't set the LSN because that
* would corrupt the page.
* The page may be uninitialized. If so, we can't set the LSN
* because that would corrupt the page.
*/
if (!PageIsNew(pages[j]))
{

View File

@ -160,7 +160,7 @@ struct typmap
FormData_pg_type am_typ;
};
static List *Typ = NIL; /* List of struct typmap* */
static List *Typ = NIL; /* List of struct typmap* */
static struct typmap *Ap = NULL;
static Datum values[MAXATTR]; /* current row's attribute values */
@ -926,11 +926,12 @@ gettype(char *type)
{
if (Typ != NIL)
{
ListCell *lc;
ListCell *lc;
foreach (lc, Typ)
foreach(lc, Typ)
{
struct typmap *app = lfirst(lc);
if (strncmp(NameStr(app->am_typ.typname), type, NAMEDATALEN) == 0)
{
Ap = app;
@ -948,12 +949,13 @@ gettype(char *type)
populate_typ_list();
/*
* Calling gettype would result in infinite recursion for types missing
* in pg_type, so just repeat the lookup.
* Calling gettype would result in infinite recursion for types
* missing in pg_type, so just repeat the lookup.
*/
foreach (lc, Typ)
foreach(lc, Typ)
{
struct typmap *app = lfirst(lc);
if (strncmp(NameStr(app->am_typ.typname), type, NAMEDATALEN) == 0)
{
Ap = app;
@ -1004,9 +1006,9 @@ boot_get_type_io_data(Oid typid,
{
/* We have the boot-time contents of pg_type, so use it */
struct typmap *ap = NULL;
ListCell *lc;
ListCell *lc;
foreach (lc, Typ)
foreach(lc, Typ)
{
ap = lfirst(lc);
if (ap->am_oid == typid)

View File

@ -94,18 +94,21 @@ sub ParseHeader
push @{ $catalog{toasting} },
{ parent_table => $1, toast_oid => $2, toast_index_oid => $3 };
}
elsif (/^DECLARE_(UNIQUE_)?INDEX(_PKEY)?\(\s*(\w+),\s*(\d+),\s*(.+)\)/)
elsif (
/^DECLARE_(UNIQUE_)?INDEX(_PKEY)?\(\s*(\w+),\s*(\d+),\s*(.+)\)/)
{
push @{ $catalog{indexing} },
{
{
is_unique => $1 ? 1 : 0,
is_pkey => $2 ? 1 : 0,
is_pkey => $2 ? 1 : 0,
index_name => $3,
index_oid => $4,
index_decl => $5
};
}
elsif (/^DECLARE_(ARRAY_)?FOREIGN_KEY(_OPT)?\(\s*\(([^)]+)\),\s*(\w+),\s*\(([^)]+)\)\)/)
elsif (
/^DECLARE_(ARRAY_)?FOREIGN_KEY(_OPT)?\(\s*\(([^)]+)\),\s*(\w+),\s*\(([^)]+)\)\)/
)
{
push @{ $catalog{foreign_keys} },
{

View File

@ -3926,8 +3926,8 @@ pg_class_aclmask_ext(Oid table_oid, Oid roleid, AclMode mask,
ReleaseSysCache(tuple);
/*
* Check if ACL_SELECT is being checked and, if so, and not set already
* as part of the result, then check if the user is a member of the
* Check if ACL_SELECT is being checked and, if so, and not set already as
* part of the result, then check if the user is a member of the
* pg_read_all_data role, which allows read access to all relations.
*/
if (mask & ACL_SELECT && !(result & ACL_SELECT) &&
@ -3935,14 +3935,14 @@ pg_class_aclmask_ext(Oid table_oid, Oid roleid, AclMode mask,
result |= ACL_SELECT;
/*
* Check if ACL_INSERT, ACL_UPDATE, or ACL_DELETE is being checked
* and, if so, and not set already as part of the result, then check
* if the user is a member of the pg_write_all_data role, which
* allows INSERT/UPDATE/DELETE access to all relations (except
* system catalogs, which requires superuser, see above).
* Check if ACL_INSERT, ACL_UPDATE, or ACL_DELETE is being checked and, if
* so, and not set already as part of the result, then check if the user
* is a member of the pg_write_all_data role, which allows
* INSERT/UPDATE/DELETE access to all relations (except system catalogs,
* which requires superuser, see above).
*/
if (mask & (ACL_INSERT | ACL_UPDATE | ACL_DELETE) &&
!(result & (ACL_INSERT | ACL_UPDATE | ACL_DELETE)) &&
!(result & (ACL_INSERT | ACL_UPDATE | ACL_DELETE)) &&
has_privs_of_role(roleid, ROLE_PG_WRITE_ALL_DATA))
result |= (mask & (ACL_INSERT | ACL_UPDATE | ACL_DELETE));
@ -4273,10 +4273,10 @@ pg_namespace_aclmask(Oid nsp_oid, Oid roleid,
ReleaseSysCache(tuple);
/*
* Check if ACL_USAGE is being checked and, if so, and not set already
* as part of the result, then check if the user is a member of the
* pg_read_all_data or pg_write_all_data roles, which allow usage
* access to all schemas.
* Check if ACL_USAGE is being checked and, if so, and not set already as
* part of the result, then check if the user is a member of the
* pg_read_all_data or pg_write_all_data roles, which allow usage access
* to all schemas.
*/
if (mask & ACL_USAGE && !(result & ACL_USAGE) &&
(has_privs_of_role(roleid, ROLE_PG_READ_ALL_DATA) ||
@ -4568,7 +4568,7 @@ pg_attribute_aclcheck(Oid table_oid, AttrNumber attnum,
*/
AclResult
pg_attribute_aclcheck_ext(Oid table_oid, AttrNumber attnum,
Oid roleid, AclMode mode, bool *is_missing)
Oid roleid, AclMode mode, bool *is_missing)
{
if (pg_attribute_aclmask_ext(table_oid, attnum, roleid, mode,
ACLMASK_ANY, is_missing) != 0)

View File

@ -1120,7 +1120,7 @@ reportDependentObjects(const ObjectAddresses *targetObjects,
*/
ereport(DEBUG2,
(errmsg_internal("drop auto-cascades to %s",
objDesc)));
objDesc)));
}
else if (behavior == DROP_RESTRICT)
{

View File

@ -786,9 +786,9 @@ close $fk_info;
close $constraints;
# Finally, rename the completed files into place.
Catalog::RenameTempFile($bkifile, $tmpext);
Catalog::RenameTempFile($schemafile, $tmpext);
Catalog::RenameTempFile($fk_info_file, $tmpext);
Catalog::RenameTempFile($bkifile, $tmpext);
Catalog::RenameTempFile($schemafile, $tmpext);
Catalog::RenameTempFile($fk_info_file, $tmpext);
Catalog::RenameTempFile($constraints_file, $tmpext);
exit 0;

View File

@ -382,8 +382,8 @@ ConstructTupleDescriptor(Relation heapRelation,
* For expression columns, set attcompression invalid, since
* there's no table column from which to copy the value. Whenever
* we actually need to compress a value, we'll use whatever the
* current value of default_compression_method is at that point
* in time.
* current value of default_compression_method is at that point in
* time.
*/
to->attcompression = InvalidCompressionMethod;
@ -2927,14 +2927,14 @@ index_build(Relation heapRelation,
if (indexInfo->ii_ParallelWorkers == 0)
ereport(DEBUG1,
(errmsg_internal("building index \"%s\" on table \"%s\" serially",
RelationGetRelationName(indexRelation),
RelationGetRelationName(heapRelation))));
RelationGetRelationName(indexRelation),
RelationGetRelationName(heapRelation))));
else
ereport(DEBUG1,
(errmsg_internal("building index \"%s\" on table \"%s\" with request for %d parallel workers",
RelationGetRelationName(indexRelation),
RelationGetRelationName(heapRelation),
indexInfo->ii_ParallelWorkers)));
RelationGetRelationName(indexRelation),
RelationGetRelationName(heapRelation),
indexInfo->ii_ParallelWorkers)));
/*
* Switch to the table owner's userid, so that any index functions are run
@ -3619,8 +3619,7 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
SetRelationTableSpace(iRel, params->tablespaceOid, InvalidOid);
/*
* Schedule unlinking of the old index storage at transaction
* commit.
* Schedule unlinking of the old index storage at transaction commit.
*/
RelationDropStorage(iRel);
RelationAssumeNewRelfilenode(iRel);

View File

@ -96,7 +96,8 @@
*/
typedef struct
{
const char *class_descr; /* string describing the catalog, for internal error messages */
const char *class_descr; /* string describing the catalog, for internal
* error messages */
Oid class_oid; /* oid of catalog */
Oid oid_index_oid; /* oid of index on system oid column */
int oid_catcache_id; /* id of catcache on system oid column */
@ -2871,6 +2872,7 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
char *attname = get_attname(object->objectId,
object->objectSubId,
missing_ok);
if (!attname)
break;
@ -2888,6 +2890,7 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
bits16 flags = FORMAT_PROC_INVALID_AS_NULL;
char *proname = format_procedure_extended(object->objectId,
flags);
if (proname == NULL)
break;
@ -2900,6 +2903,7 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
bits16 flags = FORMAT_TYPE_INVALID_AS_NULL;
char *typname = format_type_extended(object->objectId, -1,
flags);
if (typname == NULL)
break;
@ -3861,6 +3865,7 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
{
char *pubname = get_publication_name(object->objectId,
missing_ok);
if (pubname)
appendStringInfo(&buffer, _("publication %s"), pubname);
break;
@ -3901,6 +3906,7 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
{
char *subname = get_subscription_name(object->objectId,
missing_ok);
if (subname)
appendStringInfo(&buffer, _("subscription %s"), subname);
break;
@ -4708,6 +4714,7 @@ getObjectIdentityParts(const ObjectAddress *object,
bits16 flags = FORMAT_PROC_FORCE_QUALIFY | FORMAT_PROC_INVALID_AS_NULL;
char *proname = format_procedure_extended(object->objectId,
flags);
if (proname == NULL)
break;
@ -4957,6 +4964,7 @@ getObjectIdentityParts(const ObjectAddress *object,
bits16 flags = FORMAT_OPERATOR_FORCE_QUALIFY | FORMAT_OPERATOR_INVALID_AS_NULL;
char *oprname = format_operator_extended(object->objectId,
flags);
if (oprname == NULL)
break;

View File

@ -578,7 +578,7 @@ DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool expect_detach_pending,
parent = ((Form_pg_inherits) GETSTRUCT(inheritsTuple))->inhparent;
if (!OidIsValid(inhparent) || parent == inhparent)
{
bool detach_pending;
bool detach_pending;
detach_pending =
((Form_pg_inherits) GETSTRUCT(inheritsTuple))->inhdetachpending;
@ -640,7 +640,7 @@ PartitionHasPendingDetach(Oid partoid)
while (HeapTupleIsValid(inheritsTuple = systable_getnext(scan)))
{
bool detached;
bool detached;
detached =
((Form_pg_inherits) GETSTRUCT(inheritsTuple))->inhdetachpending;

View File

@ -903,10 +903,10 @@ fmgr_sql_validator(PG_FUNCTION_ARGS)
else
{
/*
* We can't do full prechecking of the function definition if there
* are any polymorphic input types, because actual datatypes of
* expression results will be unresolvable. The check will be done at
* runtime instead.
* We can't do full prechecking of the function definition if
* there are any polymorphic input types, because actual datatypes
* of expression results will be unresolvable. The check will be
* done at runtime instead.
*
* We can run the text through the raw parser though; this will at
* least catch silly syntactic errors.
@ -917,8 +917,8 @@ fmgr_sql_validator(PG_FUNCTION_ARGS)
if (!haspolyarg)
{
/*
* OK to do full precheck: analyze and rewrite the queries, then
* verify the result type.
* OK to do full precheck: analyze and rewrite the queries,
* then verify the result type.
*/
SQLFunctionParseInfoPtr pinfo;

View File

@ -361,7 +361,7 @@ void
recordDependencyOnTablespace(Oid classId, Oid objectId, Oid tablespace)
{
ObjectAddress myself,
referenced;
referenced;
ObjectAddressSet(myself, classId, objectId);
ObjectAddressSet(referenced, TableSpaceRelationId, tablespace);

View File

@ -433,6 +433,7 @@ RemoveSubscriptionRel(Oid subid, Oid relid)
get_subscription_name(subrel->srsubid, false)),
errdetail("Table synchronization for relation \"%s\" is in progress and is in state \"%c\".",
get_rel_name(relid), subrel->srsubstate),
/*
* translator: first %s is a SQL ALTER command and second %s is a
* SQL DROP command

View File

@ -351,9 +351,8 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
table_close(class_rel, RowExclusiveLock);
/*
* Register dependency from the toast table to the main, so that the
* toast table will be deleted if the main is. Skip this in bootstrap
* mode.
* Register dependency from the toast table to the main, so that the toast
* table will be deleted if the main is. Skip this in bootstrap mode.
*/
if (!IsBootstrapProcessingMode())
{
@ -396,9 +395,9 @@ needs_toast_table(Relation rel)
/*
* Ignore attempts to create toast tables on catalog tables after initdb.
* Which catalogs get toast tables is explicitly chosen in
* catalog/pg_*.h. (We could get here via some ALTER TABLE command if
* the catalog doesn't have a toast table.)
* Which catalogs get toast tables is explicitly chosen in catalog/pg_*.h.
* (We could get here via some ALTER TABLE command if the catalog doesn't
* have a toast table.)
*/
if (IsCatalogRelation(rel) && !IsBootstrapProcessingMode())
return false;

View File

@ -617,11 +617,10 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
*
* We assume that VACUUM hasn't set pg_class.reltuples already, even
* during a VACUUM ANALYZE. Although VACUUM often updates pg_class,
* exceptions exist. A "VACUUM (ANALYZE, INDEX_CLEANUP OFF)" command
* will never update pg_class entries for index relations. It's also
* possible that an individual index's pg_class entry won't be updated
* during VACUUM if the index AM returns NULL from its amvacuumcleanup()
* routine.
* exceptions exist. A "VACUUM (ANALYZE, INDEX_CLEANUP OFF)" command will
* never update pg_class entries for index relations. It's also possible
* that an individual index's pg_class entry won't be updated during
* VACUUM if the index AM returns NULL from its amvacuumcleanup() routine.
*/
if (!inh)
{
@ -659,9 +658,9 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
else if (onerel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
{
/*
* Partitioned tables don't have storage, so we don't set any fields in
* their pg_class entries except for reltuples, which is necessary for
* auto-analyze to work properly.
* Partitioned tables don't have storage, so we don't set any fields
* in their pg_class entries except for reltuples, which is necessary
* for auto-analyze to work properly.
*/
vac_update_relstats(onerel, -1, totalrows,
0, false, InvalidTransactionId,

View File

@ -104,7 +104,7 @@ typedef struct CopyToStateData
typedef struct
{
DestReceiver pub; /* publicly-known function pointers */
CopyToState cstate; /* CopyToStateData for the command */
CopyToState cstate; /* CopyToStateData for the command */
uint64 processed; /* # of tuples processed */
} DR_copy;
@ -348,7 +348,7 @@ BeginCopyTo(ParseState *pstate,
List *attnamelist,
List *options)
{
CopyToState cstate;
CopyToState cstate;
bool pipe = (filename == NULL);
TupleDesc tupDesc;
int num_phys_attrs;
@ -415,7 +415,7 @@ BeginCopyTo(ParseState *pstate,
oldcontext = MemoryContextSwitchTo(cstate->copycontext);
/* Extract options from the statement node tree */
ProcessCopyOptions(pstate, &cstate->opts, false /* is_from */, options);
ProcessCopyOptions(pstate, &cstate->opts, false /* is_from */ , options);
/* Process the source/target relation or query */
if (rel)
@ -793,7 +793,7 @@ DoCopyTo(CopyToState cstate)
else
tupDesc = cstate->queryDesc->tupDesc;
num_phys_attrs = tupDesc->natts;
cstate->opts.null_print_client = cstate->opts.null_print; /* default */
cstate->opts.null_print_client = cstate->opts.null_print; /* default */
/* We use fe_msgbuf as a per-row buffer regardless of copy_dest */
cstate->fe_msgbuf = makeStringInfo();
@ -850,8 +850,8 @@ DoCopyTo(CopyToState cstate)
*/
if (cstate->need_transcoding)
cstate->opts.null_print_client = pg_server_to_any(cstate->opts.null_print,
cstate->opts.null_print_len,
cstate->file_encoding);
cstate->opts.null_print_len,
cstate->file_encoding);
/* if a header has been requested send the line */
if (cstate->opts.header_line)
@ -1265,7 +1265,7 @@ static bool
copy_dest_receive(TupleTableSlot *slot, DestReceiver *self)
{
DR_copy *myState = (DR_copy *) self;
CopyToState cstate = myState->cstate;
CopyToState cstate = myState->cstate;
/* Send the data */
CopyOneRowTo(cstate, slot);

View File

@ -167,7 +167,7 @@ ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
ExplainState *es = NewExplainState();
TupOutputState *tstate;
JumbleState *jstate = NULL;
Query *query;
Query *query;
List *rewritten;
ListCell *lc;
bool timing_set = false;
@ -458,7 +458,7 @@ ExplainOneUtility(Node *utilityStmt, IntoClause *into, ExplainState *es,
else if (ctas->objtype == OBJECT_MATVIEW)
ExplainDummyGroup("CREATE MATERIALIZED VIEW", NULL, es);
else
elog(ERROR, "unexpected object type: %d",
elog(ERROR, "unexpected object type: %d",
(int) ctas->objtype);
return;
}
@ -612,7 +612,7 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
if (es->verbose && plannedstmt->queryId != UINT64CONST(0))
{
char buf[MAXINT8LEN+1];
char buf[MAXINT8LEN + 1];
pg_lltoa(plannedstmt->queryId, buf);
ExplainPropertyText("Query Identifier", buf, es);
@ -3298,7 +3298,7 @@ show_hashagg_info(AggState *aggstate, ExplainState *es)
if (aggstate->hash_batches_used > 1)
{
appendStringInfo(es->str, " Disk Usage: " UINT64_FORMAT "kB",
aggstate->hash_disk_used);
aggstate->hash_disk_used);
}
}

View File

@ -3293,8 +3293,8 @@ ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
case OBJECT_SUBSCRIPTION:
case OBJECT_TABLESPACE:
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("cannot add an object of this type to an extension")));
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("cannot add an object of this type to an extension")));
break;
default:
/* OK */

View File

@ -1086,9 +1086,9 @@ DefineIndex(Oid relationId,
ereport(DEBUG1,
(errmsg_internal("%s %s will create implicit index \"%s\" for table \"%s\"",
is_alter_table ? "ALTER TABLE / ADD" : "CREATE TABLE /",
constraint_type,
indexRelationName, RelationGetRelationName(rel))));
is_alter_table ? "ALTER TABLE / ADD" : "CREATE TABLE /",
constraint_type,
indexRelationName, RelationGetRelationName(rel))));
}
/*

View File

@ -628,7 +628,7 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data)
InvalidXLogRecPtr);
ereport(DEBUG1,
(errmsg_internal("table \"%s.%s\" added to subscription \"%s\"",
rv->schemaname, rv->relname, sub->name)));
rv->schemaname, rv->relname, sub->name)));
}
}
@ -702,9 +702,9 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data)
ereport(DEBUG1,
(errmsg_internal("table \"%s.%s\" removed from subscription \"%s\"",
get_namespace_name(get_rel_namespace(relid)),
get_rel_name(relid),
sub->name)));
get_namespace_name(get_rel_namespace(relid)),
get_rel_name(relid),
sub->name)));
}
}

View File

@ -563,7 +563,7 @@ static void ATExecGenericOptions(Relation rel, List *options);
static void ATExecSetRowSecurity(Relation rel, bool rls);
static void ATExecForceNoForceRowSecurity(Relation rel, bool force_rls);
static ObjectAddress ATExecSetCompression(AlteredTableInfo *tab, Relation rel,
const char *column, Node *newValue, LOCKMODE lockmode);
const char *column, Node *newValue, LOCKMODE lockmode);
static void index_copy_data(Relation rel, RelFileNode newrnode);
static const char *storage_name(char c);
@ -2593,7 +2593,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence,
if (CompressionMethodIsValid(attribute->attcompression))
{
const char *compression =
GetCompressionMethodName(attribute->attcompression);
GetCompressionMethodName(attribute->attcompression);
if (def->compression == NULL)
def->compression = pstrdup(compression);
@ -2641,7 +2641,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence,
def->location = -1;
if (CompressionMethodIsValid(attribute->attcompression))
def->compression = pstrdup(GetCompressionMethodName(
attribute->attcompression));
attribute->attcompression));
else
def->compression = NULL;
inhSchema = lappend(inhSchema, def);
@ -4524,7 +4524,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
/* No command-specific prep needed */
pass = AT_PASS_MISC;
break;
case AT_SetCompression: /* ALTER COLUMN SET COMPRESSION */
case AT_SetCompression: /* ALTER COLUMN SET COMPRESSION */
ATSimplePermissions(rel, ATT_TABLE | ATT_MATVIEW);
/* This command never recurses */
/* No command-specific prep needed */
@ -5666,11 +5666,11 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode)
if (newrel)
ereport(DEBUG1,
(errmsg_internal("rewriting table \"%s\"",
RelationGetRelationName(oldrel))));
RelationGetRelationName(oldrel))));
else
ereport(DEBUG1,
(errmsg_internal("verifying table \"%s\"",
RelationGetRelationName(oldrel))));
RelationGetRelationName(oldrel))));
if (newrel)
{
@ -7297,7 +7297,7 @@ NotNullImpliedByRelConstraints(Relation rel, Form_pg_attribute attr)
{
ereport(DEBUG1,
(errmsg_internal("existing constraints on column \"%s.%s\" are sufficient to prove that it does not contain nulls",
RelationGetRelationName(rel), NameStr(attr->attname))));
RelationGetRelationName(rel), NameStr(attr->attname))));
return true;
}
@ -12876,7 +12876,7 @@ ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId, char *cmd,
}
else if (IsA(stm, CreateStatsStmt))
{
CreateStatsStmt *stmt = (CreateStatsStmt *) stm;
CreateStatsStmt *stmt = (CreateStatsStmt *) stm;
AlterTableCmd *newcmd;
/* keep the statistics object's comment */
@ -14539,9 +14539,9 @@ MergeAttributesIntoExisting(Relation child_rel, Relation parent_rel)
if (strcmp(child_expr, parent_expr) != 0)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("column \"%s\" in child table has a conflicting generation expression",
attributeName)));
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("column \"%s\" in child table has a conflicting generation expression",
attributeName)));
}
/*
@ -14769,7 +14769,7 @@ static void
MarkInheritDetached(Relation child_rel, Relation parent_rel)
{
Relation catalogRelation;
SysScanDesc scan;
SysScanDesc scan;
ScanKeyData key;
HeapTuple inheritsTuple;
bool found = false;
@ -15645,7 +15645,7 @@ ATExecSetCompression(AlteredTableInfo *tab,
if (!IsStorageCompressible(typstorage))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("column data type %s does not support compression",
errmsg("column data type %s does not support compression",
format_type_be(atttableform->atttypid))));
/* get the attribute compression method. */
@ -17010,11 +17010,11 @@ QueuePartitionConstraintValidation(List **wqueue, Relation scanrel,
if (!validate_default)
ereport(DEBUG1,
(errmsg_internal("partition constraint for table \"%s\" is implied by existing constraints",
RelationGetRelationName(scanrel))));
RelationGetRelationName(scanrel))));
else
ereport(DEBUG1,
(errmsg_internal("updated partition constraint for default partition \"%s\" is implied by existing constraints",
RelationGetRelationName(scanrel))));
RelationGetRelationName(scanrel))));
return;
}
@ -17745,8 +17745,8 @@ ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
AccessExclusiveLock);
/*
* Check inheritance conditions and either delete the pg_inherits row
* (in non-concurrent mode) or just set the inhdetachpending flag.
* Check inheritance conditions and either delete the pg_inherits row (in
* non-concurrent mode) or just set the inhdetachpending flag.
*/
if (!concurrent)
RemoveInheritance(partRel, rel, false);
@ -17771,11 +17771,11 @@ ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
*/
if (concurrent)
{
Oid partrelid,
parentrelid;
Oid partrelid,
parentrelid;
LOCKTAG tag;
char *parentrelname;
char *partrelname;
char *parentrelname;
char *partrelname;
/*
* Add a new constraint to the partition being detached, which
@ -17815,10 +17815,10 @@ ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
StartTransactionCommand();
/*
* Now wait. This ensures that all queries that were planned including
* the partition are finished before we remove the rest of catalog
* entries. We don't need or indeed want to acquire this lock, though
* -- that would block later queries.
* Now wait. This ensures that all queries that were planned
* including the partition are finished before we remove the rest of
* catalog entries. We don't need or indeed want to acquire this
* lock, though -- that would block later queries.
*
* We don't need to concern ourselves with waiting for a lock on the
* partition itself, since we will acquire AccessExclusiveLock below.
@ -18046,7 +18046,7 @@ DetachPartitionFinalize(Relation rel, Relation partRel, bool concurrent,
static ObjectAddress
ATExecDetachPartitionFinalize(Relation rel, RangeVar *name)
{
Relation partRel;
Relation partRel;
ObjectAddress address;
Snapshot snap = GetActiveSnapshot();

View File

@ -4353,7 +4353,7 @@ GetAfterTriggersStoreSlot(AfterTriggersTableData *table,
/* Create it if not already done. */
if (!table->storeslot)
{
MemoryContext oldcxt;
MemoryContext oldcxt;
/*
* We only need this slot only until AfterTriggerEndQuery, but making

View File

@ -1569,7 +1569,7 @@ DefineRange(CreateRangeStmt *stmt)
/* Create the multirange that goes with it */
if (multirangeTypeName)
{
Oid old_typoid;
Oid old_typoid;
/*
* Look to see if multirange type already exists.
@ -1579,8 +1579,8 @@ DefineRange(CreateRangeStmt *stmt)
ObjectIdGetDatum(multirangeNamespace));
/*
* If it's not a shell, see if it's an autogenerated array type, and if so
* rename it out of the way.
* If it's not a shell, see if it's an autogenerated array type, and
* if so rename it out of the way.
*/
if (OidIsValid(old_typoid) && get_typisdefined(old_typoid))
{
@ -1600,7 +1600,7 @@ DefineRange(CreateRangeStmt *stmt)
mltrngaddress =
TypeCreate(multirangeOid, /* force assignment of this type OID */
multirangeTypeName, /* type name */
multirangeNamespace, /* namespace */
multirangeNamespace, /* namespace */
InvalidOid, /* relation oid (n/a here) */
0, /* relation kind (ditto) */
GetUserId(), /* owner's ID */
@ -1682,7 +1682,7 @@ DefineRange(CreateRangeStmt *stmt)
TypeCreate(multirangeArrayOid, /* force assignment of this type OID */
multirangeArrayName, /* type name */
multirangeNamespace, /* namespace */
multirangeNamespace, /* namespace */
InvalidOid, /* relation oid (n/a here) */
0, /* relation kind (ditto) */
GetUserId(), /* owner's ID */
@ -1844,7 +1844,7 @@ makeMultirangeConstructors(const char *name, Oid namespace,
PROKIND_FUNCTION,
false, /* security_definer */
false, /* leakproof */
true, /* isStrict */
true, /* isStrict */
PROVOLATILE_IMMUTABLE, /* volatility */
PROPARALLEL_SAFE, /* parallel safety */
argtypes, /* parameterTypes */
@ -1929,7 +1929,7 @@ makeMultirangeConstructors(const char *name, Oid namespace,
PROKIND_FUNCTION,
false, /* security_definer */
false, /* leakproof */
true, /* isStrict */
true, /* isStrict */
PROVOLATILE_IMMUTABLE, /* volatility */
PROPARALLEL_SAFE, /* parallel safety */
argtypes, /* parameterTypes */

View File

@ -1173,8 +1173,8 @@ vacuum_xid_failsafe_check(TransactionId relfrozenxid, MultiXactId relminmxid)
/*
* Similar to above, determine the index skipping age to use for
* multixact. In any case no less than autovacuum_multixact_freeze_max_age
* * 1.05.
* multixact. In any case no less than autovacuum_multixact_freeze_max_age *
* 1.05.
*/
skip_index_vacuum = Max(vacuum_multixact_failsafe_age,
autovacuum_multixact_freeze_max_age * 1.05);

View File

@ -427,6 +427,7 @@ ExecSupportsMarkRestore(Path *pathnode)
{
case T_IndexScan:
case T_IndexOnlyScan:
/*
* Not all index types support mark/restore.
*/

View File

@ -26,7 +26,7 @@ void
ExecAsyncRequest(AsyncRequest *areq)
{
if (areq->requestee->chgParam != NULL) /* something changed? */
ExecReScan(areq->requestee); /* let ReScan handle this */
ExecReScan(areq->requestee); /* let ReScan handle this */
/* must provide our own instrumentation support */
if (areq->requestee->instrument)
@ -124,7 +124,7 @@ ExecAsyncResponse(AsyncRequest *areq)
default:
/* If the node doesn't support async, caller messed up. */
elog(ERROR, "unrecognized node type: %d",
(int) nodeTag(areq->requestor));
(int) nodeTag(areq->requestor));
}
}

View File

@ -132,8 +132,8 @@ ExecutorStart(QueryDesc *queryDesc, int eflags)
/*
* In some cases (e.g. an EXECUTE statement) a query execution will skip
* parse analysis, which means that the query_id won't be reported. Note
* that it's harmless to report the query_id multiple time, as the call will
* be ignored if the top level query_id has already been reported.
* that it's harmless to report the query_id multiple time, as the call
* will be ignored if the top level query_id has already been reported.
*/
pgstat_report_query_id(queryDesc->plannedstmt->queryId, false);

View File

@ -917,8 +917,8 @@ ExecInitRoutingInfo(ModifyTableState *mtstate,
partRelInfo->ri_FdwRoutine->BeginForeignInsert(mtstate, partRelInfo);
/*
* Determine if the FDW supports batch insert and determine the batch
* size (a FDW may support batching, but it may be disabled for the
* Determine if the FDW supports batch insert and determine the batch size
* (a FDW may support batching, but it may be disabled for the
* server/table or for this particular query).
*
* If the FDW does not support batching, we set the batch size to 1.

View File

@ -349,7 +349,7 @@ typedef struct HashAggSpill
int64 *ntuples; /* number of tuples in each partition */
uint32 mask; /* mask to find partition from hash value */
int shift; /* after masking, shift by this amount */
hyperLogLogState *hll_card; /* cardinality estimate for contents */
hyperLogLogState *hll_card; /* cardinality estimate for contents */
} HashAggSpill;
/*
@ -374,9 +374,9 @@ typedef struct HashAggBatch
/* used to find referenced colnos */
typedef struct FindColsContext
{
bool is_aggref; /* is under an aggref */
Bitmapset *aggregated; /* column references under an aggref */
Bitmapset *unaggregated; /* other column references */
bool is_aggref; /* is under an aggref */
Bitmapset *aggregated; /* column references under an aggref */
Bitmapset *unaggregated; /* other column references */
} FindColsContext;
static void select_current_set(AggState *aggstate, int setno, bool is_hash);
@ -1397,7 +1397,7 @@ project_aggregates(AggState *aggstate)
static void
find_cols(AggState *aggstate, Bitmapset **aggregated, Bitmapset **unaggregated)
{
Agg *agg = (Agg *) aggstate->ss.ps.plan;
Agg *agg = (Agg *) aggstate->ss.ps.plan;
FindColsContext context;
context.is_aggref = false;
@ -1579,7 +1579,8 @@ find_hash_columns(AggState *aggstate)
for (int i = 0; i < scanDesc->natts; i++)
{
int colno = i + 1;
int colno = i + 1;
if (bms_is_member(colno, aggstate->colnos_needed))
aggstate->max_colno_needed = colno;
else
@ -3158,10 +3159,10 @@ hashagg_spill_finish(AggState *aggstate, HashAggSpill *spill, int setno)
for (i = 0; i < spill->npartitions; i++)
{
LogicalTapeSet *tapeset = aggstate->hash_tapeinfo->tapeset;
int tapenum = spill->partitions[i];
HashAggBatch *new_batch;
double cardinality;
LogicalTapeSet *tapeset = aggstate->hash_tapeinfo->tapeset;
int tapenum = spill->partitions[i];
HashAggBatch *new_batch;
double cardinality;
/* if the partition is empty, don't create a new batch of work */
if (spill->ntuples[i] == 0)

View File

@ -566,9 +566,9 @@ choose_next_subplan_locally(AppendState *node)
/*
* If first call then have the bms member function choose the first valid
* sync subplan by initializing whichplan to -1. If there happen to be
* no valid sync subplans then the bms member function will handle that
* by returning a negative number which will allow us to exit returning a
* sync subplan by initializing whichplan to -1. If there happen to be no
* valid sync subplans then the bms member function will handle that by
* returning a negative number which will allow us to exit returning a
* false value.
*/
if (whichplan == INVALID_SUBPLAN_INDEX)
@ -925,8 +925,8 @@ ExecAppendAsyncGetNext(AppendState *node, TupleTableSlot **result)
/*
* If all sync subplans are complete, we're totally done scanning the
* given node. Otherwise, we're done with the asynchronous stuff but
* must continue scanning the sync subplans.
* given node. Otherwise, we're done with the asynchronous stuff but must
* continue scanning the sync subplans.
*/
if (node->as_syncdone)
{
@ -1003,7 +1003,7 @@ ExecAppendAsyncEventWait(AppendState *node)
{
int nevents = node->as_nasyncplans + 1;
long timeout = node->as_syncdone ? -1 : 0;
WaitEvent occurred_event[EVENT_BUFFER_SIZE];
WaitEvent occurred_event[EVENT_BUFFER_SIZE];
int noccurred;
int i;
@ -1054,8 +1054,8 @@ ExecAppendAsyncEventWait(AppendState *node)
/*
* Mark it as no longer needing a callback. We must do this
* before dispatching the callback in case the callback resets
* the flag.
* before dispatching the callback in case the callback resets the
* flag.
*/
Assert(areq->callback_pending);
areq->callback_pending = false;

View File

@ -266,7 +266,7 @@ gather_getnext(GatherState *gatherstate)
PlanState *outerPlan = outerPlanState(gatherstate);
TupleTableSlot *outerTupleSlot;
TupleTableSlot *fslot = gatherstate->funnel_slot;
MinimalTuple tup;
MinimalTuple tup;
while (gatherstate->nreaders > 0 || gatherstate->need_to_scan_locally)
{
@ -278,7 +278,7 @@ gather_getnext(GatherState *gatherstate)
if (HeapTupleIsValid(tup))
{
ExecStoreMinimalTuple(tup, /* tuple to store */
ExecStoreMinimalTuple(tup, /* tuple to store */
fslot, /* slot to store the tuple */
false); /* don't pfree tuple */
return fslot;

View File

@ -700,9 +700,9 @@ gather_merge_readnext(GatherMergeState *gm_state, int reader, bool nowait)
Assert(tup);
/* Build the TupleTableSlot for the given tuple */
ExecStoreMinimalTuple(tup, /* tuple to store */
gm_state->gm_slots[reader], /* slot in which to store
* the tuple */
ExecStoreMinimalTuple(tup, /* tuple to store */
gm_state->gm_slots[reader], /* slot in which to
* store the tuple */
true); /* pfree tuple when done with it */
return true;

View File

@ -1162,8 +1162,8 @@ ExecReScanIncrementalSort(IncrementalSortState *node)
}
/*
* If chgParam of subnode is not null, then the plan will be re-scanned
* by the first ExecProcNode.
* If chgParam of subnode is not null, then the plan will be re-scanned by
* the first ExecProcNode.
*/
if (outerPlan->chgParam == NULL)
ExecReScan(outerPlan);

View File

@ -61,12 +61,12 @@ typedef struct MTTargetRelLookup
} MTTargetRelLookup;
static void ExecBatchInsert(ModifyTableState *mtstate,
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int numSlots,
EState *estate,
bool canSetTag);
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int numSlots,
EState *estate,
bool canSetTag);
static bool ExecOnConflictUpdate(ModifyTableState *mtstate,
ResultRelInfo *resultRelInfo,
ItemPointer conflictTid,
@ -673,17 +673,17 @@ ExecInsert(ModifyTableState *mtstate,
if (resultRelInfo->ri_BatchSize > 1)
{
/*
* If a certain number of tuples have already been accumulated,
* or a tuple has come for a different relation than that for
* the accumulated tuples, perform the batch insert
* If a certain number of tuples have already been accumulated, or
* a tuple has come for a different relation than that for the
* accumulated tuples, perform the batch insert
*/
if (resultRelInfo->ri_NumSlots == resultRelInfo->ri_BatchSize)
{
ExecBatchInsert(mtstate, resultRelInfo,
resultRelInfo->ri_Slots,
resultRelInfo->ri_PlanSlots,
resultRelInfo->ri_NumSlots,
estate, canSetTag);
resultRelInfo->ri_Slots,
resultRelInfo->ri_PlanSlots,
resultRelInfo->ri_NumSlots,
estate, canSetTag);
resultRelInfo->ri_NumSlots = 0;
}
@ -692,9 +692,9 @@ ExecInsert(ModifyTableState *mtstate,
if (resultRelInfo->ri_Slots == NULL)
{
resultRelInfo->ri_Slots = palloc(sizeof(TupleTableSlot *) *
resultRelInfo->ri_BatchSize);
resultRelInfo->ri_BatchSize);
resultRelInfo->ri_PlanSlots = palloc(sizeof(TupleTableSlot *) *
resultRelInfo->ri_BatchSize);
resultRelInfo->ri_BatchSize);
}
resultRelInfo->ri_Slots[resultRelInfo->ri_NumSlots] =
@ -982,12 +982,12 @@ ExecInsert(ModifyTableState *mtstate,
*/
static void
ExecBatchInsert(ModifyTableState *mtstate,
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int numSlots,
EState *estate,
bool canSetTag)
ResultRelInfo *resultRelInfo,
TupleTableSlot **slots,
TupleTableSlot **planSlots,
int numSlots,
EState *estate,
bool canSetTag)
{
int i;
int numInserted = numSlots;
@ -998,10 +998,10 @@ ExecBatchInsert(ModifyTableState *mtstate,
* insert into foreign table: let the FDW do it
*/
rslots = resultRelInfo->ri_FdwRoutine->ExecForeignBatchInsert(estate,
resultRelInfo,
slots,
planSlots,
&numInserted);
resultRelInfo,
slots,
planSlots,
&numInserted);
for (i = 0; i < numInserted; i++)
{
@ -2604,10 +2604,10 @@ ExecModifyTable(PlanState *pstate)
resultRelInfo = lfirst(lc);
if (resultRelInfo->ri_NumSlots > 0)
ExecBatchInsert(node, resultRelInfo,
resultRelInfo->ri_Slots,
resultRelInfo->ri_PlanSlots,
resultRelInfo->ri_NumSlots,
estate, node->canSetTag);
resultRelInfo->ri_Slots,
resultRelInfo->ri_PlanSlots,
resultRelInfo->ri_NumSlots,
estate, node->canSetTag);
}
/*
@ -3091,12 +3091,12 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
mtstate->mt_resultOidHash = NULL;
/*
* Determine if the FDW supports batch insert and determine the batch
* size (a FDW may support batching, but it may be disabled for the
* Determine if the FDW supports batch insert and determine the batch size
* (a FDW may support batching, but it may be disabled for the
* server/table).
*
* We only do this for INSERT, so that for UPDATE/DELETE the batch
* size remains set to 0.
* We only do this for INSERT, so that for UPDATE/DELETE the batch size
* remains set to 0.
*/
if (operation == CMD_INSERT)
{

View File

@ -769,9 +769,9 @@ llvm_compile_module(LLVMJitContext *context)
ereport(DEBUG1,
(errmsg_internal("time to inline: %.3fs, opt: %.3fs, emit: %.3fs",
INSTR_TIME_GET_DOUBLE(context->base.instr.inlining_counter),
INSTR_TIME_GET_DOUBLE(context->base.instr.optimization_counter),
INSTR_TIME_GET_DOUBLE(context->base.instr.emission_counter)),
INSTR_TIME_GET_DOUBLE(context->base.instr.inlining_counter),
INSTR_TIME_GET_DOUBLE(context->base.instr.optimization_counter),
INSTR_TIME_GET_DOUBLE(context->base.instr.emission_counter)),
errhidestmt(true),
errhidecontext(true)));
}
@ -1094,7 +1094,7 @@ llvm_resolve_symbol(const char *symname, void *ctx)
static LLVMErrorRef
llvm_resolve_symbols(LLVMOrcDefinitionGeneratorRef GeneratorObj, void *Ctx,
LLVMOrcLookupStateRef *LookupState, LLVMOrcLookupKind Kind,
LLVMOrcLookupStateRef * LookupState, LLVMOrcLookupKind Kind,
LLVMOrcJITDylibRef JD, LLVMOrcJITDylibLookupFlags JDLookupFlags,
LLVMOrcCLookupSet LookupSet, size_t LookupSetSize)
{

View File

@ -711,17 +711,16 @@ recv_password_packet(Port *port)
if (mtype != 'p')
{
/*
* If the client just disconnects without offering a password,
* don't make a log entry. This is legal per protocol spec and in
* fact commonly done by psql, so complaining just clutters the
* log.
* If the client just disconnects without offering a password, don't
* make a log entry. This is legal per protocol spec and in fact
* commonly done by psql, so complaining just clutters the log.
*/
if (mtype != EOF)
ereport(ERROR,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
errmsg("expected password response, got message type %d",
mtype)));
return NULL; /* EOF or bad message type */
return NULL; /* EOF or bad message type */
}
initStringInfo(&buf);

View File

@ -602,6 +602,7 @@ aloop:
port->peer_cn = NULL;
return -1;
}
/*
* RFC2253 is the closest thing to an accepted standard format for
* DNs. We have documented how to produce this format from a

View File

@ -175,8 +175,8 @@ WaitEventSet *FeBeWaitSet;
void
pq_init(void)
{
int socket_pos PG_USED_FOR_ASSERTS_ONLY;
int latch_pos PG_USED_FOR_ASSERTS_ONLY;
int socket_pos PG_USED_FOR_ASSERTS_ONLY;
int latch_pos PG_USED_FOR_ASSERTS_ONLY;
/* initialize state variables */
PqSendBufferSize = PQ_SEND_BUFFER_SIZE;

View File

@ -1907,11 +1907,11 @@ create_gather_merge_plan(PlannerInfo *root, GatherMergePath *best_path)
/*
* All gather merge paths should have already guaranteed the necessary sort
* order either by adding an explicit sort node or by using presorted input.
* We can't simply add a sort here on additional pathkeys, because we can't
* guarantee the sort would be safe. For example, expressions may be
* volatile or otherwise parallel unsafe.
* All gather merge paths should have already guaranteed the necessary
* sort order either by adding an explicit sort node or by using presorted
* input. We can't simply add a sort here on additional pathkeys, because
* we can't guarantee the sort would be safe. For example, expressions may
* be volatile or otherwise parallel unsafe.
*/
if (!pathkeys_contained_in(pathkeys, best_path->subpath->pathkeys))
elog(ERROR, "gather merge input not sufficiently sorted");

View File

@ -350,34 +350,34 @@ expand_insert_targetlist(List *tlist, Relation rel)
Oid attcollation = att_tup->attcollation;
Node *new_expr;
if (!att_tup->attisdropped)
{
new_expr = (Node *) makeConst(atttype,
-1,
attcollation,
att_tup->attlen,
(Datum) 0,
true, /* isnull */
att_tup->attbyval);
new_expr = coerce_to_domain(new_expr,
InvalidOid, -1,
atttype,
COERCION_IMPLICIT,
COERCE_IMPLICIT_CAST,
-1,
false);
}
else
{
/* Insert NULL for dropped column */
new_expr = (Node *) makeConst(INT4OID,
-1,
InvalidOid,
sizeof(int32),
(Datum) 0,
true, /* isnull */
true /* byval */ );
}
if (!att_tup->attisdropped)
{
new_expr = (Node *) makeConst(atttype,
-1,
attcollation,
att_tup->attlen,
(Datum) 0,
true, /* isnull */
att_tup->attbyval);
new_expr = coerce_to_domain(new_expr,
InvalidOid, -1,
atttype,
COERCION_IMPLICIT,
COERCE_IMPLICIT_CAST,
-1,
false);
}
else
{
/* Insert NULL for dropped column */
new_expr = (Node *) makeConst(INT4OID,
-1,
InvalidOid,
sizeof(int32),
(Datum) 0,
true, /* isnull */
true /* byval */ );
}
new_tle = makeTargetEntry((Expr *) new_expr,
attrno,

View File

@ -2563,9 +2563,9 @@ eval_const_expressions_mutator(Node *node,
}
case T_NullIfExpr:
{
NullIfExpr *expr;
ListCell *arg;
bool has_nonconst_input = false;
NullIfExpr *expr;
ListCell *arg;
bool has_nonconst_input = false;
/* Copy the node and const-simplify its arguments */
expr = (NullIfExpr *) ece_generic_processing(node);
@ -4359,49 +4359,49 @@ inline_function(Oid funcid, Oid result_type, Oid result_collid,
}
else
{
/*
* Set up to handle parameters while parsing the function body. We need a
* dummy FuncExpr node containing the already-simplified arguments to pass
* to prepare_sql_fn_parse_info. (In some cases we don't really need
* that, but for simplicity we always build it.)
*/
fexpr = makeNode(FuncExpr);
fexpr->funcid = funcid;
fexpr->funcresulttype = result_type;
fexpr->funcretset = false;
fexpr->funcvariadic = funcvariadic;
fexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */
fexpr->funccollid = result_collid; /* doesn't matter */
fexpr->inputcollid = input_collid;
fexpr->args = args;
fexpr->location = -1;
/*
* Set up to handle parameters while parsing the function body. We
* need a dummy FuncExpr node containing the already-simplified
* arguments to pass to prepare_sql_fn_parse_info. (In some cases we
* don't really need that, but for simplicity we always build it.)
*/
fexpr = makeNode(FuncExpr);
fexpr->funcid = funcid;
fexpr->funcresulttype = result_type;
fexpr->funcretset = false;
fexpr->funcvariadic = funcvariadic;
fexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */
fexpr->funccollid = result_collid; /* doesn't matter */
fexpr->inputcollid = input_collid;
fexpr->args = args;
fexpr->location = -1;
pinfo = prepare_sql_fn_parse_info(func_tuple,
(Node *) fexpr,
input_collid);
pinfo = prepare_sql_fn_parse_info(func_tuple,
(Node *) fexpr,
input_collid);
/* fexpr also provides a convenient way to resolve a composite result */
(void) get_expr_result_type((Node *) fexpr,
NULL,
&rettupdesc);
/* fexpr also provides a convenient way to resolve a composite result */
(void) get_expr_result_type((Node *) fexpr,
NULL,
&rettupdesc);
/*
* We just do parsing and parse analysis, not rewriting, because rewriting
* will not affect table-free-SELECT-only queries, which is all that we
* care about. Also, we can punt as soon as we detect more than one
* command in the function body.
*/
raw_parsetree_list = pg_parse_query(src);
if (list_length(raw_parsetree_list) != 1)
goto fail;
/*
* We just do parsing and parse analysis, not rewriting, because
* rewriting will not affect table-free-SELECT-only queries, which is
* all that we care about. Also, we can punt as soon as we detect
* more than one command in the function body.
*/
raw_parsetree_list = pg_parse_query(src);
if (list_length(raw_parsetree_list) != 1)
goto fail;
pstate = make_parsestate(NULL);
pstate->p_sourcetext = src;
sql_fn_parser_setup(pstate, pinfo);
pstate = make_parsestate(NULL);
pstate->p_sourcetext = src;
sql_fn_parser_setup(pstate, pinfo);
querytree = transformTopLevelStmt(pstate, linitial(raw_parsetree_list));
querytree = transformTopLevelStmt(pstate, linitial(raw_parsetree_list));
free_parsestate(pstate);
free_parsestate(pstate);
}
/*
@ -4931,31 +4931,31 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
}
else
{
/*
* Set up to handle parameters while parsing the function body. We can
* use the FuncExpr just created as the input for
* prepare_sql_fn_parse_info.
*/
pinfo = prepare_sql_fn_parse_info(func_tuple,
(Node *) fexpr,
fexpr->inputcollid);
/*
* Set up to handle parameters while parsing the function body. We
* can use the FuncExpr just created as the input for
* prepare_sql_fn_parse_info.
*/
pinfo = prepare_sql_fn_parse_info(func_tuple,
(Node *) fexpr,
fexpr->inputcollid);
/*
* Parse, analyze, and rewrite (unlike inline_function(), we can't skip
* rewriting here). We can fail as soon as we find more than one query,
* though.
*/
raw_parsetree_list = pg_parse_query(src);
if (list_length(raw_parsetree_list) != 1)
goto fail;
/*
* Parse, analyze, and rewrite (unlike inline_function(), we can't
* skip rewriting here). We can fail as soon as we find more than one
* query, though.
*/
raw_parsetree_list = pg_parse_query(src);
if (list_length(raw_parsetree_list) != 1)
goto fail;
querytree_list = pg_analyze_and_rewrite_params(linitial(raw_parsetree_list),
src,
(ParserSetupHook) sql_fn_parser_setup,
pinfo, NULL);
if (list_length(querytree_list) != 1)
goto fail;
querytree = linitial(querytree_list);
querytree_list = pg_analyze_and_rewrite_params(linitial(raw_parsetree_list),
src,
(ParserSetupHook) sql_fn_parser_setup,
pinfo, NULL);
if (list_length(querytree_list) != 1)
goto fail;
querytree = linitial(querytree_list);
}
/*

View File

@ -2752,7 +2752,7 @@ transformDeclareCursorStmt(ParseState *pstate, DeclareCursorStmt *stmt)
(stmt->options & CURSOR_OPT_NO_SCROLL))
ereport(ERROR,
(errcode(ERRCODE_INVALID_CURSOR_DEFINITION),
/* translator: %s is a SQL keyword */
/* translator: %s is a SQL keyword */
errmsg("cannot specify both %s and %s",
"SCROLL", "NO SCROLL")));
@ -2760,7 +2760,7 @@ transformDeclareCursorStmt(ParseState *pstate, DeclareCursorStmt *stmt)
(stmt->options & CURSOR_OPT_INSENSITIVE))
ereport(ERROR,
(errcode(ERRCODE_INVALID_CURSOR_DEFINITION),
/* translator: %s is a SQL keyword */
/* translator: %s is a SQL keyword */
errmsg("cannot specify both %s and %s",
"ASENSITIVE", "INSENSITIVE")));

View File

@ -1749,19 +1749,20 @@ cmp_list_len_asc(const ListCell *a, const ListCell *b)
static int
cmp_list_len_contents_asc(const ListCell *a, const ListCell *b)
{
int res = cmp_list_len_asc(a, b);
int res = cmp_list_len_asc(a, b);
if (res == 0)
{
List *la = (List *) lfirst(a);
List *lb = (List *) lfirst(b);
ListCell *lca;
ListCell *lcb;
List *la = (List *) lfirst(a);
List *lb = (List *) lfirst(b);
ListCell *lca;
ListCell *lcb;
forboth(lca, la, lcb, lb)
{
int va = lfirst_int(lca);
int vb = lfirst_int(lcb);
int va = lfirst_int(lca);
int vb = lfirst_int(lcb);
if (va > vb)
return 1;
if (va < vb)

View File

@ -356,7 +356,7 @@ analyzeCTE(ParseState *pstate, CommonTableExpr *cte)
* than just being recursive. It basically means the query expression
* looks like
*
* non-recursive query UNION [ALL] recursive query
* non-recursive query UNION [ALL] recursive query
*
* and that the recursive query is not itself a set operation.
*

View File

@ -2360,8 +2360,8 @@ addRangeTableEntryForCTE(ParseState *pstate,
* list --- caller must do that if appropriate.
*/
psi = buildNSItemFromLists(rte, list_length(pstate->p_rtable),
rte->coltypes, rte->coltypmods,
rte->colcollations);
rte->coltypes, rte->coltypmods,
rte->colcollations);
/*
* The columns added by search and cycle clauses are not included in star

View File

@ -447,8 +447,8 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column,
ereport(DEBUG1,
(errmsg_internal("%s will create implicit sequence \"%s\" for serial column \"%s.%s\"",
cxt->stmtType, sname,
cxt->relation->relname, column->colname)));
cxt->stmtType, sname,
cxt->relation->relname, column->colname)));
/*
* Build a CREATE SEQUENCE command to create the sequence object, and add

View File

@ -2876,7 +2876,10 @@ check_new_partition_bound(char *relname, Relation parent,
{
int prev_modulus;
/* We found the largest modulus less than or equal to ours. */
/*
* We found the largest modulus less than or equal to
* ours.
*/
prev_modulus = DatumGetInt32(boundinfo->datums[offset][0]);
if (spec->modulus % prev_modulus != 0)
@ -3171,7 +3174,7 @@ check_default_partition_contents(Relation parent, Relation default_rel,
{
ereport(DEBUG1,
(errmsg_internal("updated partition constraint for default partition \"%s\" is implied by existing constraints",
RelationGetRelationName(default_rel))));
RelationGetRelationName(default_rel))));
return;
}
@ -3222,7 +3225,7 @@ check_default_partition_contents(Relation parent, Relation default_rel,
{
ereport(DEBUG1,
(errmsg_internal("updated partition constraint for default partition \"%s\" is implied by existing constraints",
RelationGetRelationName(part_rel))));
RelationGetRelationName(part_rel))));
table_close(part_rel, NoLock);
continue;

View File

@ -336,8 +336,8 @@ RelationBuildPartitionDesc(Relation rel, bool omit_detached)
* descriptor, it contains an old partition descriptor that may still be
* referenced somewhere. Preserve it, while not leaking it, by
* reattaching it as a child context of the new one. Eventually it will
* get dropped by either RelationClose or RelationClearRelation.
* (We keep the regular partdesc in rd_pdcxt, and the partdesc-excluding-
* get dropped by either RelationClose or RelationClearRelation. (We keep
* the regular partdesc in rd_pdcxt, and the partdesc-excluding-
* detached-partitions in rd_pddcxt.)
*/
if (is_omit)

View File

@ -142,7 +142,11 @@ EnableLockPagesPrivilege(int elevel)
{
ereport(elevel,
(errmsg("could not enable user right \"%s\": error code %lu",
/* translator: This is a term from Windows and should be translated to match the Windows localization. */
/*
* translator: This is a term from Windows and should be translated to
* match the Windows localization.
*/
_("Lock pages in memory"),
GetLastError()),
errdetail("Failed system call was %s.", "OpenProcessToken")));

View File

@ -403,7 +403,7 @@ BackgroundWorkerStateChange(bool allow_new_workers)
/* Log it! */
ereport(DEBUG1,
(errmsg_internal("registering background worker \"%s\"",
rw->rw_worker.bgw_name)));
rw->rw_worker.bgw_name)));
slist_push_head(&BackgroundWorkerList, &rw->rw_lnode);
}
@ -435,7 +435,7 @@ ForgetBackgroundWorker(slist_mutable_iter *cur)
ereport(DEBUG1,
(errmsg_internal("unregistering background worker \"%s\"",
rw->rw_worker.bgw_name)));
rw->rw_worker.bgw_name)));
slist_delete_current(cur);
free(rw);

View File

@ -1238,7 +1238,7 @@ CompactCheckpointerRequestQueue(void)
}
ereport(DEBUG1,
(errmsg_internal("compacted fsync request queue from %d entries to %d entries",
CheckpointerShmem->num_requests, preserve_count)));
CheckpointerShmem->num_requests, preserve_count)));
CheckpointerShmem->num_requests = preserve_count;
/* Cleanup. */

View File

@ -3708,7 +3708,7 @@ pgstat_write_statsfiles(bool permanent, bool allDbs)
{
fputc('R', fpout);
rc = fwrite(slotent, sizeof(PgStat_StatReplSlotEntry), 1, fpout);
(void) rc; /* we'll check for error with ferror */
(void) rc; /* we'll check for error with ferror */
}
}

View File

@ -660,6 +660,7 @@ PostmasterMain(int argc, char *argv[])
pqsignal_pm(SIGCHLD, reaper); /* handle child termination */
#ifdef SIGURG
/*
* Ignore SIGURG for now. Child processes may change this (see
* InitializeLatchSupport), but they will not receive any such signals
@ -5780,7 +5781,7 @@ do_start_bgworker(RegisteredBgWorker *rw)
ereport(DEBUG1,
(errmsg_internal("starting background worker process \"%s\"",
rw->rw_worker.bgw_name)));
rw->rw_worker.bgw_name)));
#ifdef EXEC_BACKEND
switch ((worker_pid = bgworker_forkexec(rw->rw_shmem_slot)))

View File

@ -239,7 +239,8 @@ SysLoggerMain(int argc, char *argv[])
* broken backends...
*/
pqsignal(SIGHUP, SignalHandlerForConfigReload); /* set flag to read config file */
pqsignal(SIGHUP, SignalHandlerForConfigReload); /* set flag to read config
* file */
pqsignal(SIGINT, SIG_IGN);
pqsignal(SIGTERM, SIG_IGN);
pqsignal(SIGQUIT, SIG_IGN);

View File

@ -414,7 +414,7 @@ perform_base_backup(basebackup_options *opt)
if (ti->path == NULL)
{
struct stat statbuf;
bool sendtblspclinks = true;
bool sendtblspclinks = true;
/* In the main tar, include the backup_label first... */
sendFileWithContent(BACKUP_LABEL_FILE, labelfile->data,

View File

@ -67,12 +67,6 @@ typedef struct LogicalRepCtxStruct
LogicalRepCtxStruct *LogicalRepCtx;
typedef struct LogicalRepWorkerId
{
Oid subid;
Oid relid;
} LogicalRepWorkerId;
static void ApplyLauncherWakeup(void);
static void logicalrep_launcher_onexit(int code, Datum arg);
static void logicalrep_worker_onexit(int code, Datum arg);
@ -283,7 +277,7 @@ logicalrep_worker_launch(Oid dbid, Oid subid, const char *subname, Oid userid,
ereport(DEBUG1,
(errmsg_internal("starting logical replication worker for subscription \"%s\"",
subname)));
subname)));
/* Report this after the initial starting message for consistency. */
if (max_replication_slots == 0)

View File

@ -576,8 +576,8 @@ CheckPointReplicationOrigin(void)
tmppath)));
/*
* no other backend can perform this at the same time; only one
* checkpoint can happen at a time.
* no other backend can perform this at the same time; only one checkpoint
* can happen at a time.
*/
tmpfd = OpenTransientFile(tmppath,
O_CREAT | O_EXCL | O_WRONLY | PG_BINARY);

View File

@ -2493,11 +2493,11 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn,
* need to do the cleanup and return gracefully on this error, see
* SetupCheckXidLive.
*
* This error code can be thrown by one of the callbacks we call during
* decoding so we need to ensure that we return gracefully only when we are
* sending the data in streaming mode and the streaming is not finished yet
* or when we are sending the data out on a PREPARE during a two-phase
* commit.
* This error code can be thrown by one of the callbacks we call
* during decoding so we need to ensure that we return gracefully only
* when we are sending the data in streaming mode and the streaming is
* not finished yet or when we are sending the data out on a PREPARE
* during a two-phase commit.
*/
if (errdata->sqlerrcode == ERRCODE_TRANSACTION_ROLLBACK &&
(stream_started || rbtxn_prepared(txn)))

View File

@ -1395,8 +1395,8 @@ SnapBuildWaitSnapshot(xl_running_xacts *running, TransactionId cutoff)
/*
* All transactions we needed to finish finished - try to ensure there is
* another xl_running_xacts record in a timely manner, without having to
* wait for bgwriter or checkpointer to log one. During recovery we
* can't enforce that, so we'll have to wait.
* wait for bgwriter or checkpointer to log one. During recovery we can't
* enforce that, so we'll have to wait.
*/
if (!RecoveryInProgress())
{

View File

@ -99,8 +99,8 @@ ReplicationSlot *MyReplicationSlot = NULL;
int max_replication_slots = 0; /* the maximum number of replication
* slots */
static int ReplicationSlotAcquireInternal(ReplicationSlot *slot,
const char *name, SlotAcquireBehavior behavior);
static int ReplicationSlotAcquireInternal(ReplicationSlot *slot,
const char *name, SlotAcquireBehavior behavior);
static void ReplicationSlotDropAcquired(void);
static void ReplicationSlotDropPtr(ReplicationSlot *slot);
@ -451,8 +451,8 @@ retry:
/*
* If we found the slot but it's already active in another process, we
* either error out, return the PID of the owning process, or retry
* after a short wait, as caller specified.
* either error out, return the PID of the owning process, or retry after
* a short wait, as caller specified.
*/
if (active_pid != MyProcPid)
{
@ -471,7 +471,7 @@ retry:
goto retry;
}
else if (behavior == SAB_Block)
ConditionVariableCancelSleep(); /* no sleep needed after all */
ConditionVariableCancelSleep(); /* no sleep needed after all */
/* Let everybody know we've modified this slot */
ConditionVariableBroadcast(&s->active_cv);
@ -1180,8 +1180,8 @@ restart:
ReplicationSlot *s = &ReplicationSlotCtl->replication_slots[i];
XLogRecPtr restart_lsn = InvalidXLogRecPtr;
NameData slotname;
int wspid;
int last_signaled_pid = 0;
int wspid;
int last_signaled_pid = 0;
if (!s->in_use)
continue;
@ -1204,20 +1204,20 @@ restart:
/*
* Try to mark this slot as used by this process.
*
* Note that ReplicationSlotAcquireInternal(SAB_Inquire)
* should not cancel the prepared condition variable
* if this slot is active in other process. Because in this case
* we have to wait on that CV for the process owning
* the slot to be terminated, later.
* Note that ReplicationSlotAcquireInternal(SAB_Inquire) should
* not cancel the prepared condition variable if this slot is
* active in other process. Because in this case we have to wait
* on that CV for the process owning the slot to be terminated,
* later.
*/
wspid = ReplicationSlotAcquireInternal(s, NULL, SAB_Inquire);
/*
* Exit the loop if we successfully acquired the slot or
* the slot was dropped during waiting for the owning process
* to be terminated. For example, the latter case is likely to
* happen when the slot is temporary because it's automatically
* dropped by the termination of the owning process.
* Exit the loop if we successfully acquired the slot or the slot
* was dropped during waiting for the owning process to be
* terminated. For example, the latter case is likely to happen
* when the slot is temporary because it's automatically dropped
* by the termination of the owning process.
*/
if (wspid <= 0)
break;
@ -1225,13 +1225,13 @@ restart:
/*
* Signal to terminate the process that owns the slot.
*
* There is the race condition where other process may own
* the slot after the process using it was terminated and before
* this process owns it. To handle this case, we signal again
* if the PID of the owning process is changed than the last.
* There is the race condition where other process may own the
* slot after the process using it was terminated and before this
* process owns it. To handle this case, we signal again if the
* PID of the owning process is changed than the last.
*
* XXX This logic assumes that the same PID is not reused
* very quickly.
* XXX This logic assumes that the same PID is not reused very
* quickly.
*/
if (last_signaled_pid != wspid)
{
@ -1248,8 +1248,8 @@ restart:
ConditionVariableCancelSleep();
/*
* Do nothing here and start from scratch if the slot has
* already been dropped.
* Do nothing here and start from scratch if the slot has already been
* dropped.
*/
if (wspid == -1)
goto restart;

View File

@ -415,11 +415,11 @@ pg_get_replication_slots(PG_FUNCTION_ARGS)
nulls[i++] = true;
else
{
XLogSegNo targetSeg;
uint64 slotKeepSegs;
uint64 keepSegs;
XLogSegNo failSeg;
XLogRecPtr failLSN;
XLogSegNo targetSeg;
uint64 slotKeepSegs;
uint64 keepSegs;
XLogSegNo failSeg;
XLogRecPtr failLSN;
XLByteToSeg(slot_contents.data.restart_lsn, targetSeg, wal_segment_size);

View File

@ -165,12 +165,11 @@ SyncRepWaitForLSN(XLogRecPtr lsn, bool commit)
* Since this routine gets called every commit time, it's important to
* exit quickly if sync replication is not requested. So we check
* WalSndCtl->sync_standbys_defined flag without the lock and exit
* immediately if it's false. If it's true, we need to check it again later
* while holding the lock, to check the flag and operate the sync rep
* queue atomically. This is necessary to avoid the race condition
* described in SyncRepUpdateSyncStandbysDefined(). On the other
* hand, if it's false, the lock is not necessary because we don't touch
* the queue.
* immediately if it's false. If it's true, we need to check it again
* later while holding the lock, to check the flag and operate the sync
* rep queue atomically. This is necessary to avoid the race condition
* described in SyncRepUpdateSyncStandbysDefined(). On the other hand, if
* it's false, the lock is not necessary because we don't touch the queue.
*/
if (!SyncRepRequested() ||
!((volatile WalSndCtlData *) WalSndCtl)->sync_standbys_defined)
@ -426,7 +425,7 @@ SyncRepInitConfig(void)
ereport(DEBUG1,
(errmsg_internal("standby \"%s\" now has synchronous standby priority %u",
application_name, priority)));
application_name, priority)));
}
}

View File

@ -747,8 +747,8 @@ WalRcvFetchTimeLineHistoryFiles(TimeLineID first, TimeLineID last)
writeTimeLineHistoryFile(tli, content, len);
/*
* Mark the streamed history file as ready for archiving
* if archive_mode is always.
* Mark the streamed history file as ready for archiving if
* archive_mode is always.
*/
if (XLogArchiveMode != ARCHIVE_MODE_ALWAYS)
XLogArchiveForceDone(fname);

View File

@ -2326,7 +2326,7 @@ WalSndLoop(WalSndSendDataCallback send_data)
{
ereport(DEBUG1,
(errmsg_internal("\"%s\" has now caught up with upstream server",
application_name)));
application_name)));
WalSndSetState(WALSNDSTATE_STREAMING);
}
@ -3139,7 +3139,7 @@ WalSndWakeup(void)
static void
WalSndWait(uint32 socket_events, long timeout, uint32 wait_event)
{
WaitEvent event;
WaitEvent event;
ModifyWaitEvent(FeBeWaitSet, FeBeWaitSetSocketPos, socket_events, NULL);
if (WaitEventSetWait(FeBeWaitSet, timeout, &event, 1, wait_event) == 1 &&

View File

@ -241,8 +241,8 @@ dependency_degree(StatsBuildData *data, int k, AttrNumber *dependency)
mss = multi_sort_init(k);
/*
* Translate the array of indexes to regular attnums for the dependency (we
* will need this to identify the columns in StatsBuildData).
* Translate the array of indexes to regular attnums for the dependency
* (we will need this to identify the columns in StatsBuildData).
*/
attnums_dep = (AttrNumber *) palloc(k * sizeof(AttrNumber));
for (i = 0; i < k; i++)

View File

@ -91,9 +91,9 @@ typedef struct AnlExprData
} AnlExprData;
static void compute_expr_stats(Relation onerel, double totalrows,
AnlExprData * exprdata, int nexprs,
AnlExprData *exprdata, int nexprs,
HeapTuple *rows, int numrows);
static Datum serialize_expr_stats(AnlExprData * exprdata, int nexprs);
static Datum serialize_expr_stats(AnlExprData *exprdata, int nexprs);
static Datum expr_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull);
static AnlExprData *build_expr_data(List *exprs, int stattarget);
@ -539,9 +539,9 @@ examine_attribute(Node *expr)
/*
* When analyzing an expression, believe the expression tree's type not
* the column datatype --- the latter might be the opckeytype storage
* type of the opclass, which is not interesting for our purposes. (Note:
* if we did anything with non-expression statistics columns, we'd need to
* the column datatype --- the latter might be the opckeytype storage type
* of the opclass, which is not interesting for our purposes. (Note: if
* we did anything with non-expression statistics columns, we'd need to
* figure out where to get the correct type info from, but for now that's
* not a problem.) It's not clear whether anyone will care about the
* typmod, but we store that too just in case.
@ -1788,16 +1788,16 @@ statext_mcv_clauselist_selectivity(PlannerInfo *root, List *clauses, int varReli
* attnums of expressions from it. Ignore it if it's not fully
* covered by the chosen statistics.
*
* We need to check both attributes and expressions, and reject
* if either is not covered.
* We need to check both attributes and expressions, and reject if
* either is not covered.
*/
if (!bms_is_subset(list_attnums[listidx], stat->keys) ||
!stat_covers_expressions(stat, list_exprs[listidx], NULL))
continue;
/*
* Now we know the clause is compatible (we have either attnums
* or expressions extracted from it), and was not estimated yet.
* Now we know the clause is compatible (we have either attnums or
* expressions extracted from it), and was not estimated yet.
*/
/* record simple clauses (single column or expression) */

View File

@ -3071,7 +3071,7 @@ DropRelFileNodeBuffers(SMgrRelation smgr_reln, ForkNumber *forkNum,
int j;
RelFileNodeBackend rnode;
BlockNumber nForkBlock[MAX_FORKNUM];
uint64 nBlocksToInvalidate = 0;
uint64 nBlocksToInvalidate = 0;
rnode = smgr_reln->smgr_rnode;
@ -3195,7 +3195,7 @@ DropRelFileNodesAllBuffers(SMgrRelation *smgr_reln, int nnodes)
int n = 0;
SMgrRelation *rels;
BlockNumber (*block)[MAX_FORKNUM + 1];
uint64 nBlocksToInvalidate = 0;
uint64 nBlocksToInvalidate = 0;
RelFileNode *nodes;
bool cached = true;
bool use_bsearch;

View File

@ -3288,7 +3288,7 @@ looks_like_temp_rel_name(const char *name)
static void
do_syncfs(const char *path)
{
int fd;
int fd;
fd = OpenTransientFile(path, O_RDONLY);
if (fd < 0)
@ -3394,7 +3394,7 @@ SyncDataDirectory(void)
do_syncfs("pg_wal");
return;
}
#endif /* !HAVE_SYNCFS */
#endif /* !HAVE_SYNCFS */
/*
* If possible, hint to the kernel that we're soon going to fsync the data

View File

@ -267,8 +267,8 @@ static void
SharedFileSetDeleteOnProcExit(int status, Datum arg)
{
/*
* Remove all the pending shared fileset entries. We don't use foreach() here
* because SharedFileSetDeleteAll will remove the current element in
* Remove all the pending shared fileset entries. We don't use foreach()
* here because SharedFileSetDeleteAll will remove the current element in
* filesetlist. Though we have used foreach_delete_current() to remove the
* element from filesetlist it could only fix up the state of one of the
* loops, see SharedFileSetUnregister.

Some files were not shown because too many files have changed in this diff Show More