1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-08 22:02:03 +03:00

Initial pgindent run for v12.

This is still using the 2.0 version of pg_bsd_indent.
I thought it would be good to commit this separately,
so as to document the differences between 2.0 and 2.1 behavior.

Discussion: https://postgr.es/m/16296.1558103386@sss.pgh.pa.us
This commit is contained in:
Tom Lane 2019-05-22 12:55:34 -04:00
parent 66a4bad83a
commit be76af171c
221 changed files with 1433 additions and 1302 deletions

View File

@ -1851,7 +1851,8 @@ bt_tuple_present_callback(Relation index, HeapTuple htup, Datum *values,
bool *isnull, bool tupleIsAlive, void *checkstate) bool *isnull, bool tupleIsAlive, void *checkstate)
{ {
BtreeCheckState *state = (BtreeCheckState *) checkstate; BtreeCheckState *state = (BtreeCheckState *) checkstate;
IndexTuple itup, norm; IndexTuple itup,
norm;
Assert(state->heapallindexed); Assert(state->heapallindexed);

View File

@ -922,8 +922,11 @@ check_selective_binary_conversion(RelOptInfo *baserel,
/* Skip dropped attributes (probably shouldn't see any here). */ /* Skip dropped attributes (probably shouldn't see any here). */
if (attr->attisdropped) if (attr->attisdropped)
continue; continue;
/* Skip generated columns (COPY won't accept them in the column
* list) */ /*
* Skip generated columns (COPY won't accept them in the column
* list)
*/
if (attr->attgenerated) if (attr->attgenerated)
continue; continue;
*columns = lappend(*columns, makeString(pstrdup(attname))); *columns = lappend(*columns, makeString(pstrdup(attname)));

View File

@ -214,6 +214,7 @@ g_int_compress(PG_FUNCTION_ARGS)
{ {
int r_end = dr[i]; int r_end = dr[i];
int r_start = r_end; int r_start = r_end;
while (i > 0 && lenr > 0 && dr[i - 1] == r_start - 1) while (i > 0 && lenr > 0 && dr[i - 1] == r_start - 1)
--r_start, --i, --lenr; --r_start, --i, --lenr;
dr[2 * j] = r_start; dr[2 * j] = r_start;
@ -230,6 +231,7 @@ g_int_compress(PG_FUNCTION_ARGS)
*/ */
memmove((void *) &dr[0], (void *) &dr[2 * j], 2 * (len - j) * sizeof(int32)); memmove((void *) &dr[0], (void *) &dr[2 * j], 2 * (len - j) * sizeof(int32));
} }
/* /*
* make "len" be number of array elements, not ranges * make "len" be number of array elements, not ranges
*/ */
@ -247,6 +249,7 @@ g_int_compress(PG_FUNCTION_ARGS)
memmove((void *) &dr[cand - 1], (void *) &dr[cand + 1], (len - cand - 1) * sizeof(int32)); memmove((void *) &dr[cand - 1], (void *) &dr[cand + 1], (len - cand - 1) * sizeof(int32));
len -= 2; len -= 2;
} }
/* /*
* check sparseness of result * check sparseness of result
*/ */

View File

@ -1153,8 +1153,9 @@ pgss_store(const char *query, uint64 queryId,
queryId = pgss_hash_string(query, query_len); queryId = pgss_hash_string(query, query_len);
/* /*
* If we are unlucky enough to get a hash of zero(invalid), use queryID * If we are unlucky enough to get a hash of zero(invalid), use
* as 2 instead, queryID 1 is already in use for normal statements. * queryID as 2 instead, queryID 1 is already in use for normal
* statements.
*/ */
if (queryId == UINT64CONST(0)) if (queryId == UINT64CONST(0))
queryId = UINT64CONST(2); queryId = UINT64CONST(2);

View File

@ -1934,11 +1934,11 @@ postgresBeginForeignInsert(ModifyTableState *mtstate,
bool doNothing = false; bool doNothing = false;
/* /*
* If the foreign table we are about to insert routed rows into is also * If the foreign table we are about to insert routed rows into is also an
* an UPDATE subplan result rel that will be updated later, proceeding * UPDATE subplan result rel that will be updated later, proceeding with
* with the INSERT will result in the later UPDATE incorrectly modifying * the INSERT will result in the later UPDATE incorrectly modifying those
* those routed rows, so prevent the INSERT --- it would be nice if we * routed rows, so prevent the INSERT --- it would be nice if we could
* could handle this case; but for now, throw an error for safety. * handle this case; but for now, throw an error for safety.
*/ */
if (plan && plan->operation == CMD_UPDATE && if (plan && plan->operation == CMD_UPDATE &&
(resultRelInfo->ri_usesFdwDirectModify || (resultRelInfo->ri_usesFdwDirectModify ||
@ -3773,6 +3773,7 @@ store_returning_result(PgFdwModifyState *fmstate,
fmstate->retrieved_attrs, fmstate->retrieved_attrs,
NULL, NULL,
fmstate->temp_cxt); fmstate->temp_cxt);
/* /*
* The returning slot will not necessarily be suitable to store * The returning slot will not necessarily be suitable to store
* heaptuples directly, so allow for conversion. * heaptuples directly, so allow for conversion.
@ -6059,8 +6060,8 @@ add_foreign_final_paths(PlannerInfo *root, RelOptInfo *input_rel,
/* /*
* Grouping and aggregation are not supported with FOR UPDATE/SHARE, * Grouping and aggregation are not supported with FOR UPDATE/SHARE,
* so the input_rel should be a base, join, or ordered relation; and * so the input_rel should be a base, join, or ordered relation; and
* if it's an ordered relation, its input relation should be a base * if it's an ordered relation, its input relation should be a base or
* or join relation. * join relation.
*/ */
Assert(input_rel->reloptkind == RELOPT_BASEREL || Assert(input_rel->reloptkind == RELOPT_BASEREL ||
input_rel->reloptkind == RELOPT_JOINREL || input_rel->reloptkind == RELOPT_JOINREL ||

View File

@ -787,8 +787,8 @@ expand_tuple(HeapTuple *targetHeapTuple,
} }
/* /*
* Now walk the missing attributes. If there is a missing value * Now walk the missing attributes. If there is a missing value make
* make space for it. Otherwise, it's going to be NULL. * space for it. Otherwise, it's going to be NULL.
*/ */
for (attnum = firstmissingnum; for (attnum = firstmissingnum;
attnum < natts; attnum < natts;

View File

@ -403,8 +403,8 @@ ginVacuumPostingTree(GinVacuumState *gvs, BlockNumber rootBlkno)
RBM_NORMAL, gvs->strategy); RBM_NORMAL, gvs->strategy);
/* /*
* Lock posting tree root for cleanup to ensure there are no concurrent * Lock posting tree root for cleanup to ensure there are no
* inserts. * concurrent inserts.
*/ */
LockBufferForCleanup(buffer); LockBufferForCleanup(buffer);

View File

@ -205,8 +205,8 @@ ginRedoRecompress(Page page, ginxlogRecompressDataLeaf *data)
while (segno < a_segno) while (segno < a_segno)
{ {
/* /*
* Once modification is started and page tail is copied, we've * Once modification is started and page tail is copied, we've to
* to copy unmodified segments. * copy unmodified segments.
*/ */
segsize = SizeOfGinPostingList(oldseg); segsize = SizeOfGinPostingList(oldseg);
if (tailCopy) if (tailCopy)
@ -257,8 +257,8 @@ ginRedoRecompress(Page page, ginxlogRecompressDataLeaf *data)
} }
/* /*
* We're about to start modification of the page. So, copy tail of the * We're about to start modification of the page. So, copy tail of
* page if it's not done already. * the page if it's not done already.
*/ */
if (!tailCopy && segptr != segmentend) if (!tailCopy && segptr != segmentend)
{ {

View File

@ -839,16 +839,16 @@ gistNewBuffer(Relation r)
gistcheckpage(r, buffer); gistcheckpage(r, buffer);
/* /*
* Otherwise, recycle it if deleted, and too old to have any processes * Otherwise, recycle it if deleted, and too old to have any
* interested in it. * processes interested in it.
*/ */
if (gistPageRecyclable(page)) if (gistPageRecyclable(page))
{ {
/* /*
* If we are generating WAL for Hot Standby then create a * If we are generating WAL for Hot Standby then create a WAL
* WAL record that will allow us to conflict with queries * record that will allow us to conflict with queries running
* running on standby, in case they have snapshots older * on standby, in case they have snapshots older than the
* than the page's deleteXid. * page's deleteXid.
*/ */
if (XLogStandbyInfoActive() && RelationNeedsWAL(r)) if (XLogStandbyInfoActive() && RelationNeedsWAL(r))
gistXLogPageReuse(r, blkno, GistPageGetDeleteXid(page)); gistXLogPageReuse(r, blkno, GistPageGetDeleteXid(page));

View File

@ -474,6 +474,7 @@ tuple_lock_retry:
HeapTupleHeaderGetCmin(tuple->t_data) >= cid) HeapTupleHeaderGetCmin(tuple->t_data) >= cid)
{ {
tmfd->xmax = priorXmax; tmfd->xmax = priorXmax;
/* /*
* Cmin is the problematic value, so store that. See * Cmin is the problematic value, so store that. See
* above. * above.

View File

@ -1067,9 +1067,9 @@ lazy_scan_heap(Relation onerel, VacuumParams *params, LVRelStats *vacrelstats,
* cheaper to get rid of it in the next pruning pass than * cheaper to get rid of it in the next pruning pass than
* to treat it like an indexed tuple. Finally, if index * to treat it like an indexed tuple. Finally, if index
* cleanup is disabled, the second heap pass will not * cleanup is disabled, the second heap pass will not
* execute, and the tuple will not get removed, so we * execute, and the tuple will not get removed, so we must
* must treat it like any other dead tuple that we choose * treat it like any other dead tuple that we choose to
* to keep. * keep.
* *
* If this were to happen for a tuple that actually needed * If this were to happen for a tuple that actually needed
* to be deleted, we'd be in trouble, because it'd * to be deleted, we'd be in trouble, because it'd
@ -1087,6 +1087,7 @@ lazy_scan_heap(Relation onerel, VacuumParams *params, LVRelStats *vacrelstats,
all_visible = false; all_visible = false;
break; break;
case HEAPTUPLE_LIVE: case HEAPTUPLE_LIVE:
/* /*
* Count it as live. Not only is this natural, but it's * Count it as live. Not only is this natural, but it's
* also what acquire_sample_rows() does. * also what acquire_sample_rows() does.
@ -1251,13 +1252,14 @@ lazy_scan_heap(Relation onerel, VacuumParams *params, LVRelStats *vacrelstats,
else else
{ {
/* /*
* Here, we have indexes but index cleanup is disabled. Instead of * Here, we have indexes but index cleanup is disabled.
* vacuuming the dead tuples on the heap, we just forget them. * Instead of vacuuming the dead tuples on the heap, we just
* forget them.
* *
* Note that vacrelstats->dead_tuples could have tuples which * Note that vacrelstats->dead_tuples could have tuples which
* became dead after HOT-pruning but are not marked dead yet. * became dead after HOT-pruning but are not marked dead yet.
* We do not process them because it's a very rare condition, and * We do not process them because it's a very rare condition,
* the next vacuum will process them anyway. * and the next vacuum will process them anyway.
*/ */
Assert(params->index_cleanup == VACOPT_TERNARY_DISABLED); Assert(params->index_cleanup == VACOPT_TERNARY_DISABLED);
} }

View File

@ -1811,11 +1811,11 @@ _bt_insert_parent(Relation rel,
/* /*
* Re-find and write lock the parent of buf. * Re-find and write lock the parent of buf.
* *
* It's possible that the location of buf's downlink has changed * It's possible that the location of buf's downlink has changed since
* since our initial _bt_search() descent. _bt_getstackbuf() will * our initial _bt_search() descent. _bt_getstackbuf() will detect
* detect and recover from this, updating the stack, which ensures * and recover from this, updating the stack, which ensures that the
* that the new downlink will be inserted at the correct offset. * new downlink will be inserted at the correct offset. Even buf's
* Even buf's parent may have changed. * parent may have changed.
*/ */
stack->bts_btentry = bknum; stack->bts_btentry = bknum;
pbuf = _bt_getstackbuf(rel, stack); pbuf = _bt_getstackbuf(rel, stack);

View File

@ -166,8 +166,8 @@ _bt_search(Relation rel, BTScanInsert key, Buffer *bufP, int access,
new_stack->bts_parent = stack_in; new_stack->bts_parent = stack_in;
/* /*
* Page level 1 is lowest non-leaf page level prior to leaves. So, * Page level 1 is lowest non-leaf page level prior to leaves. So, if
* if we're on the level 1 and asked to lock leaf page in write mode, * we're on the level 1 and asked to lock leaf page in write mode,
* then lock next page in write mode, because it must be a leaf. * then lock next page in write mode, because it must be a leaf.
*/ */
if (opaque->btpo.level == 1 && access == BT_WRITE) if (opaque->btpo.level == 1 && access == BT_WRITE)
@ -1235,7 +1235,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
/* Initialize remaining insertion scan key fields */ /* Initialize remaining insertion scan key fields */
inskey.heapkeyspace = _bt_heapkeyspace(rel); inskey.heapkeyspace = _bt_heapkeyspace(rel);
inskey.anynullkeys = false; /* unusued */ inskey.anynullkeys = false; /* unused */
inskey.nextkey = nextkey; inskey.nextkey = nextkey;
inskey.pivotsearch = false; inskey.pivotsearch = false;
inskey.scantid = NULL; inskey.scantid = NULL;

View File

@ -962,10 +962,10 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup)
* much smaller. * much smaller.
* *
* Since the truncated tuple is often smaller than the original * Since the truncated tuple is often smaller than the original
* tuple, it cannot just be copied in place (besides, we want * tuple, it cannot just be copied in place (besides, we want to
* to actually save space on the leaf page). We delete the * actually save space on the leaf page). We delete the original
* original high key, and add our own truncated high key at the * high key, and add our own truncated high key at the same
* same offset. * offset.
* *
* Note that the page layout won't be changed very much. oitup is * Note that the page layout won't be changed very much. oitup is
* already located at the physical beginning of tuple space, so we * already located at the physical beginning of tuple space, so we

View File

@ -192,9 +192,9 @@ vacuumLeafPage(spgBulkDeleteState *bds, Relation index, Buffer buffer,
* happened since VACUUM started. * happened since VACUUM started.
* *
* Note: we could make a tighter test by seeing if the xid is * Note: we could make a tighter test by seeing if the xid is
* "running" according to the active snapshot; but snapmgr.c doesn't * "running" according to the active snapshot; but snapmgr.c
* currently export a suitable API, and it's not entirely clear * doesn't currently export a suitable API, and it's not entirely
* that a tighter test is worth the cycles anyway. * clear that a tighter test is worth the cycles anyway.
*/ */
if (TransactionIdFollowsOrEquals(dt->xid, bds->myXmin)) if (TransactionIdFollowsOrEquals(dt->xid, bds->myXmin))
spgAddPendingTID(bds, &dt->pointer); spgAddPendingTID(bds, &dt->pointer);

View File

@ -570,9 +570,9 @@ AssignTransactionId(TransactionState s)
/* /*
* Ensure parent(s) have XIDs, so that a child always has an XID later * Ensure parent(s) have XIDs, so that a child always has an XID later
* than its parent. Mustn't recurse here, or we might get a stack overflow * than its parent. Mustn't recurse here, or we might get a stack
* if we're at the bottom of a huge stack of subtransactions none of which * overflow if we're at the bottom of a huge stack of subtransactions none
* have XIDs yet. * of which have XIDs yet.
*/ */
if (isSubXact && !FullTransactionIdIsValid(s->parent->fullTransactionId)) if (isSubXact && !FullTransactionIdIsValid(s->parent->fullTransactionId))
{ {

View File

@ -2550,8 +2550,8 @@ AddRelationNewConstraints(Relation rel,
/* /*
* If the expression is just a NULL constant, we do not bother to make * If the expression is just a NULL constant, we do not bother to make
* an explicit pg_attrdef entry, since the default behavior is * an explicit pg_attrdef entry, since the default behavior is
* equivalent. This applies to column defaults, but not for generation * equivalent. This applies to column defaults, but not for
* expressions. * generation expressions.
* *
* Note a nonobvious property of this test: if the column is of a * Note a nonobvious property of this test: if the column is of a
* domain type, what we'll get is not a bare null Const but a * domain type, what we'll get is not a bare null Const but a

View File

@ -1236,8 +1236,7 @@ index_concurrently_create_copy(Relation heapRelation, Oid oldIndexId, const char
Anum_pg_class_reloptions, &isnull); Anum_pg_class_reloptions, &isnull);
/* /*
* Extract the list of column names to be used for the index * Extract the list of column names to be used for the index creation.
* creation.
*/ */
for (int i = 0; i < indexInfo->ii_NumIndexAttrs; i++) for (int i = 0; i < indexInfo->ii_NumIndexAttrs; i++)
{ {
@ -1583,7 +1582,11 @@ index_concurrently_swap(Oid newIndexId, Oid oldIndexId, const char *oldName)
newClassRel->pgstat_info->t_counts.t_tuples_fetched = tabentry->tuples_fetched; newClassRel->pgstat_info->t_counts.t_tuples_fetched = tabentry->tuples_fetched;
newClassRel->pgstat_info->t_counts.t_blocks_fetched = tabentry->blocks_fetched; newClassRel->pgstat_info->t_counts.t_blocks_fetched = tabentry->blocks_fetched;
newClassRel->pgstat_info->t_counts.t_blocks_hit = tabentry->blocks_hit; newClassRel->pgstat_info->t_counts.t_blocks_hit = tabentry->blocks_hit;
/* The data will be sent by the next pgstat_report_stat() call. */
/*
* The data will be sent by the next pgstat_report_stat()
* call.
*/
} }
} }
} }
@ -1614,27 +1617,26 @@ index_concurrently_set_dead(Oid heapId, Oid indexId)
Relation userIndexRelation; Relation userIndexRelation;
/* /*
* No more predicate locks will be acquired on this index, and we're * No more predicate locks will be acquired on this index, and we're about
* about to stop doing inserts into the index which could show * to stop doing inserts into the index which could show conflicts with
* conflicts with existing predicate locks, so now is the time to move * existing predicate locks, so now is the time to move them to the heap
* them to the heap relation. * relation.
*/ */
userHeapRelation = table_open(heapId, ShareUpdateExclusiveLock); userHeapRelation = table_open(heapId, ShareUpdateExclusiveLock);
userIndexRelation = index_open(indexId, ShareUpdateExclusiveLock); userIndexRelation = index_open(indexId, ShareUpdateExclusiveLock);
TransferPredicateLocksToHeapRelation(userIndexRelation); TransferPredicateLocksToHeapRelation(userIndexRelation);
/* /*
* Now we are sure that nobody uses the index for queries; they just * Now we are sure that nobody uses the index for queries; they just might
* might have it open for updating it. So now we can unset indisready * have it open for updating it. So now we can unset indisready and
* and indislive, then wait till nobody could be using it at all * indislive, then wait till nobody could be using it at all anymore.
* anymore.
*/ */
index_set_state_flags(indexId, INDEX_DROP_SET_DEAD); index_set_state_flags(indexId, INDEX_DROP_SET_DEAD);
/* /*
* Invalidate the relcache for the table, so that after this commit * Invalidate the relcache for the table, so that after this commit all
* all sessions will refresh the table's index list. Forgetting just * sessions will refresh the table's index list. Forgetting just the
* the index's relcache entry is not enough. * index's relcache entry is not enough.
*/ */
CacheInvalidateRelcache(userHeapRelation); CacheInvalidateRelcache(userHeapRelation);
@ -3018,6 +3020,7 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot)
PROGRESS_CREATEIDX_PHASE_VALIDATE_IDXSCAN, PROGRESS_CREATEIDX_PHASE_VALIDATE_IDXSCAN,
0, 0, 0, 0 0, 0, 0, 0
}; };
pgstat_progress_update_multi_param(5, index, val); pgstat_progress_update_multi_param(5, index, val);
} }

View File

@ -693,10 +693,9 @@ AggregateCreate(const char *aggName,
/* /*
* If we're replacing an existing entry, we need to validate that * If we're replacing an existing entry, we need to validate that
* we're not changing anything that would break callers. * we're not changing anything that would break callers. Specifically
* Specifically we must not change aggkind or aggnumdirectargs, * we must not change aggkind or aggnumdirectargs, which affect how an
* which affect how an aggregate call is treated in parse * aggregate call is treated in parse analysis.
* analysis.
*/ */
if (aggKind != oldagg->aggkind) if (aggKind != oldagg->aggkind)
ereport(ERROR, ereport(ERROR,

View File

@ -423,7 +423,11 @@ ProcedureCreate(const char *procedureName,
prokind == PROKIND_PROCEDURE prokind == PROKIND_PROCEDURE
? errmsg("cannot change whether a procedure has output parameters") ? errmsg("cannot change whether a procedure has output parameters")
: errmsg("cannot change return type of existing function"), : errmsg("cannot change return type of existing function"),
/* translator: first %s is DROP FUNCTION, DROP PROCEDURE or DROP AGGREGATE */
/*
* translator: first %s is DROP FUNCTION, DROP PROCEDURE or DROP
* AGGREGATE
*/
errhint("Use %s %s first.", errhint("Use %s %s first.",
dropcmd, dropcmd,
format_procedure(oldproc->oid)))); format_procedure(oldproc->oid))));

View File

@ -705,8 +705,8 @@ ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc)
ExplainNode(ps, NIL, NULL, NULL, es); ExplainNode(ps, NIL, NULL, NULL, es);
/* /*
* If requested, include information about GUC parameters with values * If requested, include information about GUC parameters with values that
* that don't match the built-in defaults. * don't match the built-in defaults.
*/ */
ExplainPrintSettings(es); ExplainPrintSettings(es);
} }

View File

@ -3112,8 +3112,8 @@ ReindexRelationConcurrently(Oid relationOid, int options)
/* /*
* The index is now valid in the sense that it contains all currently * The index is now valid in the sense that it contains all currently
* interesting tuples. But since it might not contain tuples deleted just * interesting tuples. But since it might not contain tuples deleted
* before the reference snap was taken, we have to wait out any * just before the reference snap was taken, we have to wait out any
* transactions that might have older snapshots. * transactions that might have older snapshots.
*/ */
pgstat_progress_update_param(PROGRESS_CREATEIDX_PHASE, pgstat_progress_update_param(PROGRESS_CREATEIDX_PHASE,

View File

@ -465,9 +465,9 @@ UpdateStatisticsForTypeChange(Oid statsOid, Oid relationOid, int attnum,
elog(ERROR, "cache lookup failed for statistics object %u", statsOid); elog(ERROR, "cache lookup failed for statistics object %u", statsOid);
/* /*
* When none of the defined statistics types contain datum values * When none of the defined statistics types contain datum values from the
* from the table's columns then there's no need to reset the stats. * table's columns then there's no need to reset the stats. Functional
* Functional dependencies and ndistinct stats should still hold true. * dependencies and ndistinct stats should still hold true.
*/ */
if (!statext_is_kind_built(oldtup, STATS_EXT_MCV)) if (!statext_is_kind_built(oldtup, STATS_EXT_MCV))
{ {

View File

@ -1099,9 +1099,9 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
} }
/* /*
* Now add any newly specified CHECK constraints to the new relation. * Now add any newly specified CHECK constraints to the new relation. Same
* Same as for defaults above, but these need to come after partitioning * as for defaults above, but these need to come after partitioning is set
* is set up. * up.
*/ */
if (stmt->constraints) if (stmt->constraints)
AddRelationNewConstraints(rel, NIL, stmt->constraints, AddRelationNewConstraints(rel, NIL, stmt->constraints,
@ -1786,6 +1786,7 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged,
{ {
Relation toastrel = relation_open(toast_relid, Relation toastrel = relation_open(toast_relid,
AccessExclusiveLock); AccessExclusiveLock);
RelationSetNewRelfilenode(toastrel, RelationSetNewRelfilenode(toastrel,
toastrel->rd_rel->relpersistence); toastrel->rd_rel->relpersistence);
table_close(toastrel, NoLock); table_close(toastrel, NoLock);
@ -4336,6 +4337,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel,
/* nothing to do here, oid columns don't exist anymore */ /* nothing to do here, oid columns don't exist anymore */
break; break;
case AT_SetTableSpace: /* SET TABLESPACE */ case AT_SetTableSpace: /* SET TABLESPACE */
/* /*
* Only do this for partitioned tables and indexes, for which this * Only do this for partitioned tables and indexes, for which this
* is just a catalog change. Other relation types which have * is just a catalog change. Other relation types which have
@ -4626,8 +4628,8 @@ ATRewriteTables(AlterTableStmt *parsetree, List **wqueue, LOCKMODE lockmode)
{ {
/* /*
* If required, test the current data within the table against new * If required, test the current data within the table against new
* constraints generated by ALTER TABLE commands, but don't rebuild * constraints generated by ALTER TABLE commands, but don't
* data. * rebuild data.
*/ */
if (tab->constraints != NIL || tab->verify_new_notnull || if (tab->constraints != NIL || tab->verify_new_notnull ||
tab->partition_constraint != NULL) tab->partition_constraint != NULL)
@ -4798,8 +4800,8 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode)
{ {
/* /*
* If we are rebuilding the tuples OR if we added any new but not * If we are rebuilding the tuples OR if we added any new but not
* verified NOT NULL constraints, check all not-null constraints. * verified NOT NULL constraints, check all not-null constraints. This
* This is a bit of overkill but it minimizes risk of bugs, and * is a bit of overkill but it minimizes risk of bugs, and
* heap_attisnull is a pretty cheap test anyway. * heap_attisnull is a pretty cheap test anyway.
*/ */
for (i = 0; i < newTupDesc->natts; i++) for (i = 0; i < newTupDesc->natts; i++)
@ -4941,8 +4943,8 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode)
{ {
/* /*
* If there's no rewrite, old and new table are guaranteed to * If there's no rewrite, old and new table are guaranteed to
* have the same AM, so we can just use the old slot to * have the same AM, so we can just use the old slot to verify
* verify new constraints etc. * new constraints etc.
*/ */
insertslot = oldslot; insertslot = oldslot;
} }
@ -6209,9 +6211,8 @@ ATExecSetNotNull(AlteredTableInfo *tab, Relation rel,
/* /*
* Ordinarily phase 3 must ensure that no NULLs exist in columns that * Ordinarily phase 3 must ensure that no NULLs exist in columns that
* are set NOT NULL; however, if we can find a constraint which proves * are set NOT NULL; however, if we can find a constraint which proves
* this then we can skip that. We needn't bother looking if * this then we can skip that. We needn't bother looking if we've
* we've already found that we must verify some other NOT NULL * already found that we must verify some other NOT NULL constraint.
* constraint.
*/ */
if (!tab->verify_new_notnull && if (!tab->verify_new_notnull &&
!NotNullImpliedByRelConstraints(rel, (Form_pg_attribute) GETSTRUCT(tuple))) !NotNullImpliedByRelConstraints(rel, (Form_pg_attribute) GETSTRUCT(tuple)))
@ -10657,8 +10658,8 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
{ {
/* /*
* Changing the type of a column that is used by a * Changing the type of a column that is used by a
* generated column is not allowed by SQL standard. * generated column is not allowed by SQL standard. It
* It might be doable with some thinking and effort. * might be doable with some thinking and effort.
*/ */
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR), (errcode(ERRCODE_SYNTAX_ERROR),
@ -10862,8 +10863,8 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
/* /*
* Here we go --- change the recorded column type and collation. (Note * Here we go --- change the recorded column type and collation. (Note
* heapTup is a copy of the syscache entry, so okay to scribble on.) * heapTup is a copy of the syscache entry, so okay to scribble on.) First
* First fix up the missing value if any. * fix up the missing value if any.
*/ */
if (attTup->atthasmissing) if (attTup->atthasmissing)
{ {
@ -12311,8 +12312,8 @@ ATExecSetTableSpaceNoStorage(Relation rel, Oid newTableSpace)
Oid reloid = RelationGetRelid(rel); Oid reloid = RelationGetRelid(rel);
/* /*
* Shouldn't be called on relations having storage; these are processed * Shouldn't be called on relations having storage; these are processed in
* in phase 3. * phase 3.
*/ */
Assert(!RELKIND_HAS_STORAGE(rel->rd_rel->relkind)); Assert(!RELKIND_HAS_STORAGE(rel->rd_rel->relkind));
@ -15240,8 +15241,8 @@ ConstraintImpliedByRelConstraint(Relation scanrel, List *testConstraint, List *p
* not-false and try to prove the same for testConstraint. * not-false and try to prove the same for testConstraint.
* *
* Note that predicate_implied_by assumes its first argument is known * Note that predicate_implied_by assumes its first argument is known
* immutable. That should always be true for both NOT NULL and * immutable. That should always be true for both NOT NULL and partition
* partition constraints, so we don't test it here. * constraints, so we don't test it here.
*/ */
return predicate_implied_by(testConstraint, existConstraint, true); return predicate_implied_by(testConstraint, existConstraint, true);
} }

View File

@ -1143,9 +1143,9 @@ GetDefaultTablespace(char relpersistence, bool partitioned)
/* /*
* Allow explicit specification of database's default tablespace in * Allow explicit specification of database's default tablespace in
* default_tablespace without triggering permissions checks. Don't * default_tablespace without triggering permissions checks. Don't allow
* allow specifying that when creating a partitioned table, however, * specifying that when creating a partitioned table, however, since the
* since the result is confusing. * result is confusing.
*/ */
if (result == MyDatabaseTableSpace) if (result == MyDatabaseTableSpace)
{ {

View File

@ -4245,9 +4245,9 @@ AfterTriggerExecute(EState *estate,
case AFTER_TRIGGER_FDW_REUSE: case AFTER_TRIGGER_FDW_REUSE:
/* /*
* Store tuple in the slot so that tg_trigtuple does not * Store tuple in the slot so that tg_trigtuple does not reference
* reference tuplestore memory. (It is formally possible for the * tuplestore memory. (It is formally possible for the trigger
* trigger function to queue trigger events that add to the same * function to queue trigger events that add to the same
* tuplestore, which can push other tuples out of memory.) The * tuplestore, which can push other tuples out of memory.) The
* distinction is academic, because we start with a minimal tuple * distinction is academic, because we start with a minimal tuple
* that is stored as a heap tuple, constructed in different memory * that is stored as a heap tuple, constructed in different memory

View File

@ -593,8 +593,9 @@ vacuum_open_relation(Oid relid, RangeVar *relation, int options,
/* /*
* Determine the log level. * Determine the log level.
* *
* For manual VACUUM or ANALYZE, we emit a WARNING to match the log statements * For manual VACUUM or ANALYZE, we emit a WARNING to match the log
* in the permission checks; otherwise, only log if the caller so requested. * statements in the permission checks; otherwise, only log if the caller
* so requested.
*/ */
if (!IsAutoVacuumWorkerProcess()) if (!IsAutoVacuumWorkerProcess())
elevel = WARNING; elevel = WARNING;
@ -1328,9 +1329,9 @@ vac_update_datfrozenxid(void)
} }
/* /*
* Some table AMs might not need per-relation xid / multixid * Some table AMs might not need per-relation xid / multixid horizons.
* horizons. It therefore seems reasonable to allow relfrozenxid and * It therefore seems reasonable to allow relfrozenxid and relminmxid
* relminmxid to not be set (i.e. set to their respective Invalid*Id) * to not be set (i.e. set to their respective Invalid*Id)
* independently. Thus validate and compute horizon for each only if * independently. Thus validate and compute horizon for each only if
* set. * set.
* *

View File

@ -762,9 +762,9 @@ ExecInitPartitionInfo(ModifyTableState *mtstate, EState *estate,
* It's safe to reuse these from the partition root, as we * It's safe to reuse these from the partition root, as we
* only process one tuple at a time (therefore we won't * only process one tuple at a time (therefore we won't
* overwrite needed data in slots), and the results of * overwrite needed data in slots), and the results of
* projections are independent of the underlying * projections are independent of the underlying storage.
* storage. Projections and where clauses themselves don't * Projections and where clauses themselves don't store state
* store state / are independent of the underlying storage. * / are independent of the underlying storage.
*/ */
leaf_part_rri->ri_onConflict->oc_ProjSlot = leaf_part_rri->ri_onConflict->oc_ProjSlot =
rootResultRelInfo->ri_onConflict->oc_ProjSlot; rootResultRelInfo->ri_onConflict->oc_ProjSlot;
@ -1676,8 +1676,8 @@ ExecCreatePartitionPruneState(PlanState *planstate,
* those are reflected in our PartitionDesc but were not * those are reflected in our PartitionDesc but were not
* present in the one used to construct subplan_map and * present in the one used to construct subplan_map and
* subpart_map. So we must construct new and longer arrays * subpart_map. So we must construct new and longer arrays
* where the partitions that were originally present map to the * where the partitions that were originally present map to
* same place, and any added indexes map to -1, as if the * the same place, and any added indexes map to -1, as if the
* new partitions had been pruned. * new partitions had been pruned.
*/ */
pprune->subpart_map = palloc(sizeof(int) * partdesc->nparts); pprune->subpart_map = palloc(sizeof(int) * partdesc->nparts);

View File

@ -591,8 +591,8 @@ CheckSubscriptionRelkind(char relkind, const char *nspname,
const char *relname) const char *relname)
{ {
/* /*
* We currently only support writing to regular tables. However, give * We currently only support writing to regular tables. However, give a
* a more specific error for partitioned and foreign tables. * more specific error for partitioned and foreign tables.
*/ */
if (relkind == RELKIND_PARTITIONED_TABLE) if (relkind == RELKIND_PARTITIONED_TABLE)
ereport(ERROR, ereport(ERROR,

View File

@ -81,7 +81,8 @@ ExecScanFetch(ScanState *node,
/* Check if it meets the access-method conditions */ /* Check if it meets the access-method conditions */
if (!(*recheckMtd) (node, slot)) if (!(*recheckMtd) (node, slot))
return ExecClearTuple(slot); /* would not be returned by scan */ return ExecClearTuple(slot); /* would not be returned by
* scan */
return slot; return slot;
} }

View File

@ -71,8 +71,7 @@
static TupleDesc ExecTypeFromTLInternal(List *targetList, static TupleDesc ExecTypeFromTLInternal(List *targetList,
bool skipjunk); bool skipjunk);
static pg_attribute_always_inline void static pg_attribute_always_inline void slot_deform_heap_tuple(TupleTableSlot *slot, HeapTuple tuple, uint32 *offp,
slot_deform_heap_tuple(TupleTableSlot *slot, HeapTuple tuple, uint32 *offp,
int natts); int natts);
static inline void tts_buffer_heap_store_tuple(TupleTableSlot *slot, static inline void tts_buffer_heap_store_tuple(TupleTableSlot *slot,
HeapTuple tuple, HeapTuple tuple,
@ -1077,8 +1076,10 @@ TupleTableSlot *
MakeTupleTableSlot(TupleDesc tupleDesc, MakeTupleTableSlot(TupleDesc tupleDesc,
const TupleTableSlotOps *tts_ops) const TupleTableSlotOps *tts_ops)
{ {
Size basesz, allocsz; Size basesz,
allocsz;
TupleTableSlot *slot; TupleTableSlot *slot;
basesz = tts_ops->base_slot_size; basesz = tts_ops->base_slot_size;
/* /*
@ -1876,8 +1877,8 @@ slot_getsomeattrs_int(TupleTableSlot *slot, int attnum)
slot->tts_ops->getsomeattrs(slot, attnum); slot->tts_ops->getsomeattrs(slot, attnum);
/* /*
* If the underlying tuple doesn't have enough attributes, tuple descriptor * If the underlying tuple doesn't have enough attributes, tuple
* must have the missing attributes. * descriptor must have the missing attributes.
*/ */
if (unlikely(slot->tts_nvalid < attnum)) if (unlikely(slot->tts_nvalid < attnum))
{ {

View File

@ -192,9 +192,9 @@ IndexOnlyNext(IndexOnlyScanState *node)
/* /*
* Fill the scan tuple slot with data from the index. This might be * Fill the scan tuple slot with data from the index. This might be
* provided in either HeapTuple or IndexTuple format. Conceivably * provided in either HeapTuple or IndexTuple format. Conceivably an
* an index AM might fill both fields, in which case we prefer the * index AM might fill both fields, in which case we prefer the heap
* heap format, since it's probably a bit cheaper to fill a slot from. * format, since it's probably a bit cheaper to fill a slot from.
*/ */
if (scandesc->xs_hitup) if (scandesc->xs_hitup)
{ {

View File

@ -865,6 +865,7 @@ ldelete:;
goto ldelete; goto ldelete;
case TM_SelfModified: case TM_SelfModified:
/* /*
* This can be reached when following an update * This can be reached when following an update
* chain from a tuple updated by another session, * chain from a tuple updated by another session,
@ -1401,6 +1402,7 @@ lreplace:;
return NULL; return NULL;
case TM_SelfModified: case TM_SelfModified:
/* /*
* This can be reached when following an update * This can be reached when following an update
* chain from a tuple updated by another session, * chain from a tuple updated by another session,

View File

@ -131,6 +131,7 @@ ExecInitSubqueryScan(SubqueryScan *node, EState *estate, int eflags)
ExecInitScanTupleSlot(estate, &subquerystate->ss, ExecInitScanTupleSlot(estate, &subquerystate->ss,
ExecGetResultType(subquerystate->subplan), ExecGetResultType(subquerystate->subplan),
ExecGetResultSlotOps(subquerystate->subplan, NULL)); ExecGetResultSlotOps(subquerystate->subplan, NULL));
/* /*
* The slot used as the scantuple isn't the slot above (outside of EPQ), * The slot used as the scantuple isn't the slot above (outside of EPQ),
* but the one from the node below. * but the one from the node below.

View File

@ -195,6 +195,7 @@ be_tls_init(bool isServerStart)
int ssl_ver = ssl_protocol_version_to_openssl(ssl_min_protocol_version, int ssl_ver = ssl_protocol_version_to_openssl(ssl_min_protocol_version,
"ssl_min_protocol_version", "ssl_min_protocol_version",
isServerStart ? FATAL : LOG); isServerStart ? FATAL : LOG);
if (ssl_ver == -1) if (ssl_ver == -1)
goto error; goto error;
SSL_CTX_set_min_proto_version(context, ssl_ver); SSL_CTX_set_min_proto_version(context, ssl_ver);
@ -205,6 +206,7 @@ be_tls_init(bool isServerStart)
int ssl_ver = ssl_protocol_version_to_openssl(ssl_max_protocol_version, int ssl_ver = ssl_protocol_version_to_openssl(ssl_max_protocol_version,
"ssl_max_protocol_version", "ssl_max_protocol_version",
isServerStart ? FATAL : LOG); isServerStart ? FATAL : LOG);
if (ssl_ver == -1) if (ssl_ver == -1)
goto error; goto error;
SSL_CTX_set_max_proto_version(context, ssl_ver); SSL_CTX_set_max_proto_version(context, ssl_ver);
@ -1150,6 +1152,7 @@ be_tls_get_peer_serial(Port *port, char *ptr, size_t len)
serial = X509_get_serialNumber(port->peer); serial = X509_get_serialNumber(port->peer);
b = ASN1_INTEGER_to_BN(serial, NULL); b = ASN1_INTEGER_to_BN(serial, NULL);
decimal = BN_bn2dec(b); decimal = BN_bn2dec(b);
BN_free(b); BN_free(b);
strlcpy(ptr, decimal, len); strlcpy(ptr, decimal, len);
OPENSSL_free(decimal); OPENSSL_free(decimal);

View File

@ -476,10 +476,10 @@ bms_member_index(Bitmapset *a, int x)
} }
/* /*
* Now add bits of the last word, but only those before the item. * Now add bits of the last word, but only those before the item. We can
* We can do that by applying a mask and then using popcount again. * do that by applying a mask and then using popcount again. To get
* To get 0-based index, we want to count only preceding bits, not * 0-based index, we want to count only preceding bits, not the item
* the item itself, so we subtract 1. * itself, so we subtract 1.
*/ */
mask = ((bitmapword) 1 << bitnum) - 1; mask = ((bitmapword) 1 << bitnum) - 1;
result += bmw_popcount(a->words[wordnum] & mask); result += bmw_popcount(a->words[wordnum] & mask);

View File

@ -161,9 +161,9 @@ clauselist_selectivity_simple(PlannerInfo *root,
int listidx; int listidx;
/* /*
* If there's exactly one clause (and it was not estimated yet), just * If there's exactly one clause (and it was not estimated yet), just go
* go directly to clause_selectivity(). None of what we might do below * directly to clause_selectivity(). None of what we might do below is
* is relevant. * relevant.
*/ */
if ((list_length(clauses) == 1) && if ((list_length(clauses) == 1) &&
bms_num_members(estimatedclauses) == 0) bms_num_members(estimatedclauses) == 0)

View File

@ -311,6 +311,7 @@ expand_partitioned_rtentry(PlannerInfo *root, RelOptInfo *relinfo,
if (!root->partColsUpdated) if (!root->partColsUpdated)
root->partColsUpdated = root->partColsUpdated =
has_partition_attrs(parentrel, parentrte->updatedCols, NULL); has_partition_attrs(parentrel, parentrte->updatedCols, NULL);
/* /*
* There shouldn't be any generated columns in the partition key. * There shouldn't be any generated columns in the partition key.
*/ */

View File

@ -1053,8 +1053,8 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
InvalidOid, &found_whole_row); InvalidOid, &found_whole_row);
/* /*
* Prevent this for the same reason as for constraints below. * Prevent this for the same reason as for constraints below. Note
* Note that defaults cannot contain any vars, so it's OK that the * that defaults cannot contain any vars, so it's OK that the
* error message refers to generated columns. * error message refers to generated columns.
*/ */
if (found_whole_row) if (found_whole_row)
@ -3880,8 +3880,8 @@ transformPartitionRangeBounds(ParseState *pstate, List *blist,
PartitionRangeDatum *prd = NULL; PartitionRangeDatum *prd = NULL;
/* /*
* Infinite range bounds -- "minvalue" and "maxvalue" -- get passed * Infinite range bounds -- "minvalue" and "maxvalue" -- get passed in
* in as ColumnRefs. * as ColumnRefs.
*/ */
if (IsA(expr, ColumnRef)) if (IsA(expr, ColumnRef))
{ {
@ -3899,8 +3899,8 @@ transformPartitionRangeBounds(ParseState *pstate, List *blist,
if (cname == NULL) if (cname == NULL)
{ {
/* /*
* ColumnRef is not in the desired single-field-name form. * ColumnRef is not in the desired single-field-name form. For
* For consistency between all partition strategies, let the * consistency between all partition strategies, let the
* expression transformation report any errors rather than * expression transformation report any errors rather than
* doing it ourselves. * doing it ourselves.
*/ */
@ -3965,8 +3965,8 @@ transformPartitionRangeBounds(ParseState *pstate, List *blist,
} }
/* /*
* Once we see MINVALUE or MAXVALUE for one column, the remaining * Once we see MINVALUE or MAXVALUE for one column, the remaining columns
* columns must be the same. * must be the same.
*/ */
validateInfiniteBounds(pstate, result); validateInfiniteBounds(pstate, result);
@ -4030,9 +4030,9 @@ transformPartitionBoundValue(ParseState *pstate, Node *val,
/* /*
* Check that the input expression's collation is compatible with one * Check that the input expression's collation is compatible with one
* specified for the parent's partition key (partcollation). Don't * specified for the parent's partition key (partcollation). Don't throw
* throw an error if it's the default collation which we'll replace with * an error if it's the default collation which we'll replace with the
* the parent's collation anyway. * parent's collation anyway.
*/ */
if (IsA(value, CollateExpr)) if (IsA(value, CollateExpr))
{ {

View File

@ -74,9 +74,9 @@ RelationBuildPartitionDesc(Relation rel)
/* /*
* Get partition oids from pg_inherits. This uses a single snapshot to * Get partition oids from pg_inherits. This uses a single snapshot to
* fetch the list of children, so while more children may be getting * fetch the list of children, so while more children may be getting added
* added concurrently, whatever this function returns will be accurate * concurrently, whatever this function returns will be accurate as of
* as of some well-defined point in time. * some well-defined point in time.
*/ */
inhoids = find_inheritance_children(RelationGetRelid(rel), NoLock); inhoids = find_inheritance_children(RelationGetRelid(rel), NoLock);
nparts = list_length(inhoids); nparts = list_length(inhoids);
@ -122,8 +122,8 @@ RelationBuildPartitionDesc(Relation rel)
* *
* Note that this algorithm assumes that PartitionBoundSpec we manage * Note that this algorithm assumes that PartitionBoundSpec we manage
* to fetch is the right one -- so this is only good enough for * to fetch is the right one -- so this is only good enough for
* concurrent ATTACH PARTITION, not concurrent DETACH PARTITION * concurrent ATTACH PARTITION, not concurrent DETACH PARTITION or
* or some hypothetical operation that changes the partition bounds. * some hypothetical operation that changes the partition bounds.
*/ */
if (boundspec == NULL) if (boundspec == NULL)
{ {

View File

@ -1327,8 +1327,8 @@ ReorderBufferBuildTupleCidHash(ReorderBuffer *rb, ReorderBufferTXN *txn)
else else
{ {
/* /*
* Maybe we already saw this tuple before in this transaction, * Maybe we already saw this tuple before in this transaction, but
* but if so it must have the same cmin. * if so it must have the same cmin.
*/ */
Assert(ent->cmin == change->data.tuplecid.cmin); Assert(ent->cmin == change->data.tuplecid.cmin);

View File

@ -730,11 +730,11 @@ copy_replication_slot(FunctionCallInfo fcinfo, bool logical_slot)
SpinLockRelease(&src->mutex); SpinLockRelease(&src->mutex);
/* /*
* Check if the source slot still exists and is valid. We regard it * Check if the source slot still exists and is valid. We regard it as
* as invalid if the type of replication slot or name has been * invalid if the type of replication slot or name has been changed,
* changed, or the restart_lsn either is invalid or has gone backward. * or the restart_lsn either is invalid or has gone backward. (The
* (The restart_lsn could go backwards if the source slot is dropped * restart_lsn could go backwards if the source slot is dropped and
* and copied from an older slot during installation.) * copied from an older slot during installation.)
* *
* Since erroring out will release and drop the destination slot we * Since erroring out will release and drop the destination slot we
* don't need to release it here. * don't need to release it here.

View File

@ -276,9 +276,8 @@ SyncRepWaitForLSN(XLogRecPtr lsn, bool commit)
WAIT_EVENT_SYNC_REP); WAIT_EVENT_SYNC_REP);
/* /*
* If the postmaster dies, we'll probably never get an * If the postmaster dies, we'll probably never get an acknowledgment,
* acknowledgment, because all the wal sender processes will exit. So * because all the wal sender processes will exit. So just bail out.
* just bail out.
*/ */
if (rc & WL_POSTMASTER_DEATH) if (rc & WL_POSTMASTER_DEATH)
{ {

View File

@ -808,11 +808,11 @@ WalRcvQuickDieHandler(SIGNAL_ARGS)
* anyway. * anyway.
* *
* Note we use _exit(2) not _exit(0). This is to force the postmaster * Note we use _exit(2) not _exit(0). This is to force the postmaster
* into a system reset cycle if someone sends a manual SIGQUIT to a * into a system reset cycle if someone sends a manual SIGQUIT to a random
* random backend. This is necessary precisely because we don't clean up * backend. This is necessary precisely because we don't clean up our
* our shared memory state. (The "dead man switch" mechanism in * shared memory state. (The "dead man switch" mechanism in pmsignal.c
* pmsignal.c should ensure the postmaster sees this as a crash, too, but * should ensure the postmaster sees this as a crash, too, but no harm in
* no harm in being doubly sure.) * being doubly sure.)
*/ */
_exit(2); _exit(2);
} }

View File

@ -279,8 +279,8 @@ dependency_degree(int numrows, HeapTuple *rows, int k, AttrNumber *dependency,
* build an array of SortItem(s) sorted using the multi-sort support * build an array of SortItem(s) sorted using the multi-sort support
* *
* XXX This relies on all stats entries pointing to the same tuple * XXX This relies on all stats entries pointing to the same tuple
* descriptor. For now that assumption holds, but it might change in * descriptor. For now that assumption holds, but it might change in the
* the future for example if we support statistics on multiple tables. * future for example if we support statistics on multiple tables.
*/ */
items = build_sorted_items(numrows, &nitems, rows, stats[0]->tupDesc, items = build_sorted_items(numrows, &nitems, rows, stats[0]->tupDesc,
mss, k, attnums_dep); mss, k, attnums_dep);
@ -300,8 +300,8 @@ dependency_degree(int numrows, HeapTuple *rows, int k, AttrNumber *dependency,
{ {
/* /*
* Check if the group ended, which may be either because we processed * Check if the group ended, which may be either because we processed
* all the items (i==nitems), or because the i-th item is not equal * all the items (i==nitems), or because the i-th item is not equal to
* to the preceding one. * the preceding one.
*/ */
if (i == nitems || if (i == nitems ||
multi_sort_compare_dims(0, k - 2, &items[i - 1], &items[i], mss) != 0) multi_sort_compare_dims(0, k - 2, &items[i - 1], &items[i], mss) != 0)

View File

@ -538,9 +538,9 @@ build_attnums_array(Bitmapset *attrs, int *numattrs)
{ {
/* /*
* Make sure the bitmap contains only user-defined attributes. As * Make sure the bitmap contains only user-defined attributes. As
* bitmaps can't contain negative values, this can be violated in * bitmaps can't contain negative values, this can be violated in two
* two ways. Firstly, the bitmap might contain 0 as a member, and * ways. Firstly, the bitmap might contain 0 as a member, and secondly
* secondly the integer value might be larger than MaxAttrNumber. * the integer value might be larger than MaxAttrNumber.
*/ */
Assert(AttrNumberIsForUserDefinedAttr(j)); Assert(AttrNumberIsForUserDefinedAttr(j));
Assert(j <= MaxAttrNumber); Assert(j <= MaxAttrNumber);
@ -1006,9 +1006,9 @@ statext_mcv_clauselist_selectivity(PlannerInfo *root, List *clauses, int varReli
* Pre-process the clauses list to extract the attnums seen in each item. * Pre-process the clauses list to extract the attnums seen in each item.
* We need to determine if there's any clauses which will be useful for * We need to determine if there's any clauses which will be useful for
* selectivity estimations with extended stats. Along the way we'll record * selectivity estimations with extended stats. Along the way we'll record
* all of the attnums for each clause in a list which we'll reference later * all of the attnums for each clause in a list which we'll reference
* so we don't need to repeat the same work again. We'll also keep track of * later so we don't need to repeat the same work again. We'll also keep
* all attnums seen. * track of all attnums seen.
* *
* We also skip clauses that we already estimated using different types of * We also skip clauses that we already estimated using different types of
* statistics (we treat them as incompatible). * statistics (we treat them as incompatible).
@ -1066,9 +1066,10 @@ statext_mcv_clauselist_selectivity(PlannerInfo *root, List *clauses, int varReli
} }
/* /*
* First compute "simple" selectivity, i.e. without the extended statistics, * First compute "simple" selectivity, i.e. without the extended
* and essentially assuming independence of the columns/clauses. We'll then * statistics, and essentially assuming independence of the
* use the various selectivities computed from MCV list to improve it. * columns/clauses. We'll then use the various selectivities computed from
* MCV list to improve it.
*/ */
simple_sel = clauselist_selectivity_simple(root, stat_clauses, varRelid, simple_sel = clauselist_selectivity_simple(root, stat_clauses, varRelid,
jointype, sjinfo, NULL); jointype, sjinfo, NULL);
@ -1112,9 +1113,9 @@ statext_clauselist_selectivity(PlannerInfo *root, List *clauses, int varRelid,
sjinfo, rel, estimatedclauses); sjinfo, rel, estimatedclauses);
/* /*
* Then, apply functional dependencies on the remaining clauses by * Then, apply functional dependencies on the remaining clauses by calling
* calling dependencies_clauselist_selectivity. Pass 'estimatedclauses' * dependencies_clauselist_selectivity. Pass 'estimatedclauses' so the
* so the function can properly skip clauses already estimated above. * function can properly skip clauses already estimated above.
* *
* The reasoning for applying dependencies last is that the more complex * The reasoning for applying dependencies last is that the more complex
* stats can track more complex correlations between the attributes, and * stats can track more complex correlations between the attributes, and

View File

@ -209,20 +209,20 @@ statext_mcv_build(int numrows, HeapTuple *rows, Bitmapset *attrs,
* *
* Using the same algorithm might exclude items that are close to the * Using the same algorithm might exclude items that are close to the
* "average" frequency of the sample. But that does not say whether the * "average" frequency of the sample. But that does not say whether the
* observed frequency is close to the base frequency or not. We also * observed frequency is close to the base frequency or not. We also need
* need to consider unexpectedly uncommon items (again, compared to the * to consider unexpectedly uncommon items (again, compared to the base
* base frequency), and the single-column algorithm does not have to. * frequency), and the single-column algorithm does not have to.
* *
* We simply decide how many items to keep by computing minimum count * We simply decide how many items to keep by computing minimum count
* using get_mincount_for_mcv_list() and then keep all items that seem * using get_mincount_for_mcv_list() and then keep all items that seem to
* to be more common than that. * be more common than that.
*/ */
mincount = get_mincount_for_mcv_list(numrows, totalrows); mincount = get_mincount_for_mcv_list(numrows, totalrows);
/* /*
* Walk the groups until we find the first group with a count below * Walk the groups until we find the first group with a count below the
* the mincount threshold (the index of that group is the number of * mincount threshold (the index of that group is the number of groups we
* groups we want to keep). * want to keep).
*/ */
for (i = 0; i < nitems; i++) for (i = 0; i < nitems; i++)
{ {
@ -636,8 +636,8 @@ statext_mcv_serialize(MCVList * mcvlist, VacAttrStats **stats)
* for each attribute, deduplicated values and items). * for each attribute, deduplicated values and items).
* *
* The header fields are copied one by one, so that we don't need any * The header fields are copied one by one, so that we don't need any
* explicit alignment (we copy them while deserializing). All fields * explicit alignment (we copy them while deserializing). All fields after
* after this need to be properly aligned, for direct access. * this need to be properly aligned, for direct access.
*/ */
total_length = MAXALIGN(VARHDRSZ + (3 * sizeof(uint32)) total_length = MAXALIGN(VARHDRSZ + (3 * sizeof(uint32))
+ sizeof(AttrNumber) + (ndims * sizeof(Oid))); + sizeof(AttrNumber) + (ndims * sizeof(Oid)));
@ -650,14 +650,14 @@ statext_mcv_serialize(MCVList * mcvlist, VacAttrStats **stats)
total_length += MAXALIGN(info[i].nbytes); total_length += MAXALIGN(info[i].nbytes);
/* /*
* And finally the items (no additional alignment needed, we start * And finally the items (no additional alignment needed, we start at
* at proper alignment and the itemsize formula uses MAXALIGN) * proper alignment and the itemsize formula uses MAXALIGN)
*/ */
total_length += mcvlist->nitems * itemsize; total_length += mcvlist->nitems * itemsize;
/* /*
* Allocate space for the whole serialized MCV list (we'll skip bytes, * Allocate space for the whole serialized MCV list (we'll skip bytes, so
* so we set them to zero to make the result more compressible). * we set them to zero to make the result more compressible).
*/ */
raw = palloc0(total_length); raw = palloc0(total_length);
SET_VARSIZE(raw, total_length); SET_VARSIZE(raw, total_length);

View File

@ -2813,10 +2813,10 @@ RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum)
case RELKIND_MATVIEW: case RELKIND_MATVIEW:
{ {
/* /*
* Not every table AM uses BLCKSZ wide fixed size * Not every table AM uses BLCKSZ wide fixed size blocks.
* blocks. Therefore tableam returns the size in bytes - but * Therefore tableam returns the size in bytes - but for the
* for the purpose of this routine, we want the number of * purpose of this routine, we want the number of blocks.
* blocks. Therefore divide, rounding up. * Therefore divide, rounding up.
*/ */
uint64 szbytes; uint64 szbytes;

View File

@ -928,6 +928,7 @@ WaitForLockersMultiple(List *locktags, LOCKMODE lockmode, bool progress)
const int64 values[] = { const int64 values[] = {
0, 0, 0 0, 0, 0
}; };
pgstat_progress_update_multi_param(3, index, values); pgstat_progress_update_multi_param(3, index, values);
} }

View File

@ -548,8 +548,8 @@ RegisterSyncRequest(const FileTag *ftag, SyncRequestType type,
for (;;) for (;;)
{ {
/* /*
* Notify the checkpointer about it. If we fail to queue a message * Notify the checkpointer about it. If we fail to queue a message in
* in retryOnError mode, we have to sleep and try again ... ugly, but * retryOnError mode, we have to sleep and try again ... ugly, but
* hopefully won't happen often. * hopefully won't happen often.
* *
* XXX should we CHECK_FOR_INTERRUPTS in this loop? Escaping with an * XXX should we CHECK_FOR_INTERRUPTS in this loop? Escaping with an

View File

@ -113,8 +113,8 @@ DestReceiver *
CreateDestReceiver(CommandDest dest) CreateDestReceiver(CommandDest dest)
{ {
/* /*
* It's ok to cast the constness away as any modification of the none receiver * It's ok to cast the constness away as any modification of the none
* would be a bug (which gets easier to catch this way). * receiver would be a bug (which gets easier to catch this way).
*/ */
switch (dest) switch (dest)

View File

@ -3023,6 +3023,7 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out)
int len, int len,
value; value;
bool fx_mode = false; bool fx_mode = false;
/* number of extra skipped characters (more than given in format string) */ /* number of extra skipped characters (more than given in format string) */
int extra_skip = 0; int extra_skip = 0;
@ -3049,8 +3050,8 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out)
/* /*
* In non FX (fixed format) mode one format string space or * In non FX (fixed format) mode one format string space or
* separator match to one space or separator in input string. * separator match to one space or separator in input string.
* Or match nothing if there is no space or separator in * Or match nothing if there is no space or separator in the
* the current position of input string. * current position of input string.
*/ */
extra_skip--; extra_skip--;
if (isspace((unsigned char) *s) || is_separator_char(s)) if (isspace((unsigned char) *s) || is_separator_char(s))
@ -3176,11 +3177,13 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out)
n->key->name))); n->key->name)));
break; break;
case DCH_TZH: case DCH_TZH:
/* /*
* Value of TZH might be negative. And the issue is that we * Value of TZH might be negative. And the issue is that we
* might swallow minus sign as the separator. So, if we have * might swallow minus sign as the separator. So, if we have
* skipped more characters than specified in the format string, * skipped more characters than specified in the format
* then we consider prepending last skipped minus to TZH. * string, then we consider prepending last skipped minus to
* TZH.
*/ */
if (*s == '+' || *s == '-' || *s == ' ') if (*s == '+' || *s == '-' || *s == ' ')
{ {

View File

@ -2378,8 +2378,8 @@ dist_ppath(PG_FUNCTION_ARGS)
Assert(path->npts > 0); Assert(path->npts > 0);
/* /*
* The distance from a point to a path is the smallest distance * The distance from a point to a path is the smallest distance from the
* from the point to any of its constituent segments. * point to any of its constituent segments.
*/ */
for (i = 0; i < path->npts; i++) for (i = 0; i < path->npts; i++)
{ {
@ -2553,9 +2553,9 @@ lseg_interpt_line(Point *result, LSEG *lseg, LINE *line)
LINE tmp; LINE tmp;
/* /*
* First, we promote the line segment to a line, because we know how * First, we promote the line segment to a line, because we know how to
* to find the intersection point of two lines. If they don't have * find the intersection point of two lines. If they don't have an
* an intersection point, we are done. * intersection point, we are done.
*/ */
line_construct(&tmp, &lseg->p[0], lseg_sl(lseg)); line_construct(&tmp, &lseg->p[0], lseg_sl(lseg));
if (!line_interpt_line(&interpt, &tmp, line)) if (!line_interpt_line(&interpt, &tmp, line))
@ -2602,8 +2602,8 @@ line_closept_point(Point *result, LINE *line, Point *point)
LINE tmp; LINE tmp;
/* /*
* We drop a perpendicular to find the intersection point. Ordinarily * We drop a perpendicular to find the intersection point. Ordinarily we
* we should always find it, but that can fail in the presence of NaN * should always find it, but that can fail in the presence of NaN
* coordinates, and perhaps even from simple roundoff issues. * coordinates, and perhaps even from simple roundoff issues.
*/ */
line_construct(&tmp, point, line_invsl(line)); line_construct(&tmp, point, line_invsl(line));
@ -2693,8 +2693,8 @@ lseg_closept_lseg(Point *result, LSEG *on_lseg, LSEG *to_lseg)
return 0.0; return 0.0;
/* /*
* Then, we find the closest points from the endpoints of the second * Then, we find the closest points from the endpoints of the second line
* line segment, and keep the closest one. * segment, and keep the closest one.
*/ */
dist = lseg_closept_point(result, on_lseg, &to_lseg->p[0]); dist = lseg_closept_point(result, on_lseg, &to_lseg->p[0]);
d = lseg_closept_point(&point, on_lseg, &to_lseg->p[1]); d = lseg_closept_point(&point, on_lseg, &to_lseg->p[1]);

View File

@ -262,9 +262,9 @@ match_pattern_prefix(Node *leftop,
* optimized equality or prefix tests use bytewise comparisons, which is * optimized equality or prefix tests use bytewise comparisons, which is
* not consistent with nondeterministic collations. The actual * not consistent with nondeterministic collations. The actual
* pattern-matching implementation functions will later error out that * pattern-matching implementation functions will later error out that
* pattern-matching is not supported with nondeterministic collations. * pattern-matching is not supported with nondeterministic collations. (We
* (We could also error out here, but by doing it later we get more * could also error out here, but by doing it later we get more precise
* precise error messages.) (It should be possible to support at least * error messages.) (It should be possible to support at least
* Pattern_Prefix_Exact, but no point as along as the actual * Pattern_Prefix_Exact, but no point as along as the actual
* pattern-matching implementations don't support it.) * pattern-matching implementations don't support it.)
* *

View File

@ -1119,6 +1119,7 @@ setup_regexp_matches(text *orig_str, text *pattern, pg_re_flags *re_flags,
{ {
int so = pmatch[i].rm_so; int so = pmatch[i].rm_so;
int eo = pmatch[i].rm_eo; int eo = pmatch[i].rm_eo;
matchctx->match_locs[array_idx++] = so; matchctx->match_locs[array_idx++] = so;
matchctx->match_locs[array_idx++] = eo; matchctx->match_locs[array_idx++] = eo;
if (so >= 0 && eo >= 0 && (eo - so) > maxlen) if (so >= 0 && eo >= 0 && (eo - so) > maxlen)
@ -1129,6 +1130,7 @@ setup_regexp_matches(text *orig_str, text *pattern, pg_re_flags *re_flags,
{ {
int so = pmatch[0].rm_so; int so = pmatch[0].rm_so;
int eo = pmatch[0].rm_eo; int eo = pmatch[0].rm_eo;
matchctx->match_locs[array_idx++] = so; matchctx->match_locs[array_idx++] = so;
matchctx->match_locs[array_idx++] = eo; matchctx->match_locs[array_idx++] = eo;
if (so >= 0 && eo >= 0 && (eo - so) > maxlen) if (so >= 0 && eo >= 0 && (eo - so) > maxlen)
@ -1190,10 +1192,10 @@ setup_regexp_matches(text *orig_str, text *pattern, pg_re_flags *re_flags,
* interest. * interest.
* *
* Worst case: assume we need the maximum size (maxlen*eml), but take * Worst case: assume we need the maximum size (maxlen*eml), but take
* advantage of the fact that the original string length in bytes is an * advantage of the fact that the original string length in bytes is
* upper bound on the byte length of any fetched substring (and we know * an upper bound on the byte length of any fetched substring (and we
* that len+1 is safe to allocate because the varlena header is longer * know that len+1 is safe to allocate because the varlena header is
* than 1 byte). * longer than 1 byte).
*/ */
if (maxsiz > orig_len) if (maxsiz > orig_len)
conv_bufsiz = orig_len + 1; conv_bufsiz = orig_len + 1;
@ -1251,6 +1253,7 @@ build_regexp_match_result(regexp_matches_ctx *matchctx)
int len = pg_wchar2mb_with_len(matchctx->wide_str + so, int len = pg_wchar2mb_with_len(matchctx->wide_str + so,
buf, buf,
eo - so); eo - so);
Assert(len < bufsiz); Assert(len < bufsiz);
elems[i] = PointerGetDatum(cstring_to_text_with_len(buf, len)); elems[i] = PointerGetDatum(cstring_to_text_with_len(buf, len));
nulls[i] = false; nulls[i] = false;

View File

@ -635,10 +635,10 @@ ri_restrict(TriggerData *trigdata, bool is_no_action)
oldslot = trigdata->tg_trigslot; oldslot = trigdata->tg_trigslot;
/* /*
* If another PK row now exists providing the old key values, we * If another PK row now exists providing the old key values, we should
* should not do anything. However, this check should only be * not do anything. However, this check should only be made in the NO
* made in the NO ACTION case; in RESTRICT cases we don't wish to * ACTION case; in RESTRICT cases we don't wish to allow another row to be
* allow another row to be substituted. * substituted.
*/ */
if (is_no_action && if (is_no_action &&
ri_Check_Pk_Match(pk_rel, fk_rel, oldslot, riinfo)) ri_Check_Pk_Match(pk_rel, fk_rel, oldslot, riinfo))
@ -651,8 +651,8 @@ ri_restrict(TriggerData *trigdata, bool is_no_action)
elog(ERROR, "SPI_connect failed"); elog(ERROR, "SPI_connect failed");
/* /*
* Fetch or prepare a saved plan for the restrict lookup (it's the * Fetch or prepare a saved plan for the restrict lookup (it's the same
* same query for delete and update cases) * query for delete and update cases)
*/ */
ri_BuildQueryKey(&qkey, riinfo, RI_PLAN_RESTRICT_CHECKREF); ri_BuildQueryKey(&qkey, riinfo, RI_PLAN_RESTRICT_CHECKREF);
@ -813,8 +813,8 @@ RI_FKey_cascade_del(PG_FUNCTION_ARGS)
} }
/* /*
* We have a plan now. Build up the arguments from the key values * We have a plan now. Build up the arguments from the key values in the
* in the deleted PK tuple and delete the referencing rows * deleted PK tuple and delete the referencing rows
*/ */
ri_PerformCheck(riinfo, &qkey, qplan, ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel, fk_rel, pk_rel,
@ -1132,18 +1132,17 @@ ri_set(TriggerData *trigdata, bool is_set_null)
else else
{ {
/* /*
* If we just deleted or updated the PK row whose key was equal to * If we just deleted or updated the PK row whose key was equal to the
* the FK columns' default values, and a referencing row exists in * FK columns' default values, and a referencing row exists in the FK
* the FK table, we would have updated that row to the same values * table, we would have updated that row to the same values it already
* it already had --- and RI_FKey_fk_upd_check_required would * had --- and RI_FKey_fk_upd_check_required would hence believe no
* hence believe no check is necessary. So we need to do another * check is necessary. So we need to do another lookup now and in
* lookup now and in case a reference still exists, abort the * case a reference still exists, abort the operation. That is
* operation. That is already implemented in the NO ACTION * already implemented in the NO ACTION trigger, so just run it. (This
* trigger, so just run it. (This recheck is only needed in the * recheck is only needed in the SET DEFAULT case, since CASCADE would
* SET DEFAULT case, since CASCADE would remove such rows in case * remove such rows in case of a DELETE operation or would change the
* of a DELETE operation or would change the FK key values in case * FK key values in case of an UPDATE, while SET NULL is certain to
* of an UPDATE, while SET NULL is certain to result in rows that * result in rows that satisfy the FK constraint.)
* satisfy the FK constraint.)
*/ */
return ri_restrict(trigdata, true); return ri_restrict(trigdata, true);
} }
@ -1170,8 +1169,8 @@ RI_FKey_pk_upd_check_required(Trigger *trigger, Relation pk_rel,
riinfo = ri_FetchConstraintInfo(trigger, pk_rel, true); riinfo = ri_FetchConstraintInfo(trigger, pk_rel, true);
/* /*
* If any old key value is NULL, the row could not have been * If any old key value is NULL, the row could not have been referenced by
* referenced by an FK row, so no check is needed. * an FK row, so no check is needed.
*/ */
if (ri_NullCheck(RelationGetDescr(pk_rel), oldslot, riinfo, true) != RI_KEYS_NONE_NULL) if (ri_NullCheck(RelationGetDescr(pk_rel), oldslot, riinfo, true) != RI_KEYS_NONE_NULL)
return false; return false;
@ -1213,14 +1212,17 @@ RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel,
*/ */
if (ri_nullcheck == RI_KEYS_ALL_NULL) if (ri_nullcheck == RI_KEYS_ALL_NULL)
return false; return false;
/* /*
* If some new key values are NULL, the behavior depends on the match type. * If some new key values are NULL, the behavior depends on the match
* type.
*/ */
else if (ri_nullcheck == RI_KEYS_SOME_NULL) else if (ri_nullcheck == RI_KEYS_SOME_NULL)
{ {
switch (riinfo->confmatchtype) switch (riinfo->confmatchtype)
{ {
case FKCONSTR_MATCH_SIMPLE: case FKCONSTR_MATCH_SIMPLE:
/* /*
* If any new key value is NULL, the row must satisfy the * If any new key value is NULL, the row must satisfy the
* constraint, so no check is needed. * constraint, so no check is needed.
@ -1228,12 +1230,14 @@ RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel,
return false; return false;
case FKCONSTR_MATCH_PARTIAL: case FKCONSTR_MATCH_PARTIAL:
/* /*
* Don't know, must run full check. * Don't know, must run full check.
*/ */
break; break;
case FKCONSTR_MATCH_FULL: case FKCONSTR_MATCH_FULL:
/* /*
* If some new key values are NULL, the row fails the * If some new key values are NULL, the row fails the
* constraint. We must not throw error here, because the row * constraint. We must not throw error here, because the row
@ -1251,12 +1255,12 @@ RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel,
*/ */
/* /*
* If the original row was inserted by our own transaction, we * If the original row was inserted by our own transaction, we must fire
* must fire the trigger whether or not the keys are equal. This * the trigger whether or not the keys are equal. This is because our
* is because our UPDATE will invalidate the INSERT so that the * UPDATE will invalidate the INSERT so that the INSERT RI trigger will
* INSERT RI trigger will not do anything; so we had better do the * not do anything; so we had better do the UPDATE check. (We could skip
* UPDATE check. (We could skip this if we knew the INSERT * this if we knew the INSERT trigger already fired, but there is no easy
* trigger already fired, but there is no easy way to know that.) * way to know that.)
*/ */
xminDatum = slot_getsysattr(oldslot, MinTransactionIdAttributeNumber, &isnull); xminDatum = slot_getsysattr(oldslot, MinTransactionIdAttributeNumber, &isnull);
Assert(!isnull); Assert(!isnull);

View File

@ -755,8 +755,8 @@ bpchareq(PG_FUNCTION_ARGS)
pg_newlocale_from_collation(collid)->deterministic) pg_newlocale_from_collation(collid)->deterministic)
{ {
/* /*
* Since we only care about equality or not-equality, we can avoid all the * Since we only care about equality or not-equality, we can avoid all
* expense of strcoll() here, and just do bitwise comparison. * the expense of strcoll() here, and just do bitwise comparison.
*/ */
if (len1 != len2) if (len1 != len2)
result = false; result = false;
@ -793,8 +793,8 @@ bpcharne(PG_FUNCTION_ARGS)
pg_newlocale_from_collation(collid)->deterministic) pg_newlocale_from_collation(collid)->deterministic)
{ {
/* /*
* Since we only care about equality or not-equality, we can avoid all the * Since we only care about equality or not-equality, we can avoid all
* expense of strcoll() here, and just do bitwise comparison. * the expense of strcoll() here, and just do bitwise comparison.
*/ */
if (len1 != len2) if (len1 != len2)
result = true; result = true;

View File

@ -1723,11 +1723,11 @@ texteq(PG_FUNCTION_ARGS)
len2; len2;
/* /*
* Since we only care about equality or not-equality, we can avoid all the * Since we only care about equality or not-equality, we can avoid all
* expense of strcoll() here, and just do bitwise comparison. In fact, we * the expense of strcoll() here, and just do bitwise comparison. In
* don't even have to do a bitwise comparison if we can show the lengths * fact, we don't even have to do a bitwise comparison if we can show
* of the strings are unequal; which might save us from having to detoast * the lengths of the strings are unequal; which might save us from
* one or both values. * having to detoast one or both values.
*/ */
len1 = toast_raw_datum_size(arg1); len1 = toast_raw_datum_size(arg1);
len2 = toast_raw_datum_size(arg2); len2 = toast_raw_datum_size(arg2);

View File

@ -2635,9 +2635,9 @@ RelationClearRelation(Relation relation, bool rebuild)
* there should be no PartitionDirectory with a pointer to the old * there should be no PartitionDirectory with a pointer to the old
* entry. * entry.
* *
* Note that newrel and relation have already been swapped, so * Note that newrel and relation have already been swapped, so the
* the "old" partition descriptor is actually the one hanging off * "old" partition descriptor is actually the one hanging off of
* of newrel. * newrel.
*/ */
MemoryContextSetParent(newrel->rd_pdcxt, relation->rd_pdcxt); MemoryContextSetParent(newrel->rd_pdcxt, relation->rd_pdcxt);
newrel->rd_partdesc = NULL; newrel->rd_partdesc = NULL;

View File

@ -653,6 +653,7 @@ hash_uint32_extended(uint32 k, uint64 seed)
/* report the result */ /* report the result */
PG_RETURN_UINT64(((uint64) b << 32) | c); PG_RETURN_UINT64(((uint64) b << 32) | c);
} }
/* /*
* string_hash: hash function for keys that are NUL-terminated strings. * string_hash: hash function for keys that are NUL-terminated strings.
* *

View File

@ -592,8 +592,8 @@ InitializeSessionUserId(const char *rolename, Oid roleid)
AssertState(!OidIsValid(AuthenticatedUserId)); AssertState(!OidIsValid(AuthenticatedUserId));
/* /*
* Make sure syscache entries are flushed for recent catalog changes. * Make sure syscache entries are flushed for recent catalog changes. This
* This allows us to find roles that were created on-the-fly during * allows us to find roles that were created on-the-fly during
* authentication. * authentication.
*/ */
AcceptInvalidationMessages(); AcceptInvalidationMessages();

View File

@ -1599,6 +1599,7 @@ static struct config_bool ConfigureNamesBool[] =
true, true,
NULL, NULL, NULL NULL, NULL, NULL
}, },
/* /*
* WITH OIDS support, and consequently default_with_oids, was removed in * WITH OIDS support, and consequently default_with_oids, was removed in
* PostgreSQL 12, but we tolerate the parameter being set to false to * PostgreSQL 12, but we tolerate the parameter being set to false to
@ -8900,9 +8901,9 @@ get_explain_guc_options(int *num)
*num = 0; *num = 0;
/* /*
* Allocate enough space to fit all GUC_EXPLAIN options. We may not * Allocate enough space to fit all GUC_EXPLAIN options. We may not need
* need all the space, but there are fairly few such options so we * all the space, but there are fairly few such options so we don't waste
* don't waste a lot of memory. * a lot of memory.
*/ */
result = palloc(sizeof(struct config_generic *) * num_guc_explain_variables); result = palloc(sizeof(struct config_generic *) * num_guc_explain_variables);
@ -8929,6 +8930,7 @@ get_explain_guc_options(int *num)
case PGC_BOOL: case PGC_BOOL:
{ {
struct config_bool *lconf = (struct config_bool *) conf; struct config_bool *lconf = (struct config_bool *) conf;
modified = (lconf->boot_val != *(lconf->variable)); modified = (lconf->boot_val != *(lconf->variable));
} }
break; break;
@ -8936,6 +8938,7 @@ get_explain_guc_options(int *num)
case PGC_INT: case PGC_INT:
{ {
struct config_int *lconf = (struct config_int *) conf; struct config_int *lconf = (struct config_int *) conf;
modified = (lconf->boot_val != *(lconf->variable)); modified = (lconf->boot_val != *(lconf->variable));
} }
break; break;
@ -8943,6 +8946,7 @@ get_explain_guc_options(int *num)
case PGC_REAL: case PGC_REAL:
{ {
struct config_real *lconf = (struct config_real *) conf; struct config_real *lconf = (struct config_real *) conf;
modified = (lconf->boot_val != *(lconf->variable)); modified = (lconf->boot_val != *(lconf->variable));
} }
break; break;
@ -8950,6 +8954,7 @@ get_explain_guc_options(int *num)
case PGC_STRING: case PGC_STRING:
{ {
struct config_string *lconf = (struct config_string *) conf; struct config_string *lconf = (struct config_string *) conf;
modified = (strcmp(lconf->boot_val, *(lconf->variable)) != 0); modified = (strcmp(lconf->boot_val, *(lconf->variable)) != 0);
} }
break; break;
@ -8957,6 +8962,7 @@ get_explain_guc_options(int *num)
case PGC_ENUM: case PGC_ENUM:
{ {
struct config_enum *lconf = (struct config_enum *) conf; struct config_enum *lconf = (struct config_enum *) conf;
modified = (lconf->boot_val != *(lconf->variable)); modified = (lconf->boot_val != *(lconf->variable));
} }
break; break;

View File

@ -1676,6 +1676,7 @@ ensure_active_superblock(dsa_area *area, dsa_area_pool *pool,
return false; return false;
} }
} }
/* /*
* This shouldn't happen: get_best_segment() or make_new_segment() * This shouldn't happen: get_best_segment() or make_new_segment()
* promised that we can successfully allocate npages. * promised that we can successfully allocate npages.

View File

@ -3067,8 +3067,8 @@ main(int argc, char *argv[])
char pg_ctl_path[MAXPGPATH]; char pg_ctl_path[MAXPGPATH];
/* /*
* Ensure that buffering behavior of stdout matches what it is * Ensure that buffering behavior of stdout matches what it is in
* in interactive usage (at least on most platforms). This prevents * interactive usage (at least on most platforms). This prevents
* unexpected output ordering when, eg, output is redirected to a file. * unexpected output ordering when, eg, output is redirected to a file.
* POSIX says we must do this before any other usage of these files. * POSIX says we must do this before any other usage of these files.
*/ */

View File

@ -123,7 +123,8 @@ CleanupPriorWALFiles(void)
if ((IsXLogFileName(walfile) || IsPartialXLogFileName(walfile)) && if ((IsXLogFileName(walfile) || IsPartialXLogFileName(walfile)) &&
strcmp(walfile + 8, exclusiveCleanupFileName + 8) < 0) strcmp(walfile + 8, exclusiveCleanupFileName + 8) < 0)
{ {
char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */ char WALFilePath[MAXPGPATH * 2]; /* the file path
* including archive */
/* /*
* Use the original file name again now, including any * Use the original file name again now, including any

View File

@ -3415,7 +3415,8 @@ static void
_selectTableAccessMethod(ArchiveHandle *AH, const char *tableam) _selectTableAccessMethod(ArchiveHandle *AH, const char *tableam)
{ {
PQExpBuffer cmd; PQExpBuffer cmd;
const char *want, *have; const char *want,
*have;
have = AH->currTableAm; have = AH->currTableAm;
want = tableam; want = tableam;

View File

@ -910,11 +910,11 @@ _readBlockHeader(ArchiveHandle *AH, int *type, int *id)
int byt; int byt;
/* /*
* Note: if we are at EOF with a pre-1.3 input file, we'll fatal() * Note: if we are at EOF with a pre-1.3 input file, we'll fatal() inside
* inside ReadInt rather than returning EOF. It doesn't seem worth * ReadInt rather than returning EOF. It doesn't seem worth jumping
* jumping through hoops to deal with that case better, because no such * through hoops to deal with that case better, because no such files are
* files are likely to exist in the wild: only some 7.1 development * likely to exist in the wild: only some 7.1 development versions of
* versions of pg_dump ever generated such files. * pg_dump ever generated such files.
*/ */
if (AH->version < K_VERS_1_3) if (AH->version < K_VERS_1_3)
*type = BLK_DATA; *type = BLK_DATA;

View File

@ -1112,13 +1112,14 @@ setup_connection(Archive *AH, const char *dumpencoding,
ExecuteSqlStatement(AH, "SET INTERVALSTYLE = POSTGRES"); ExecuteSqlStatement(AH, "SET INTERVALSTYLE = POSTGRES");
/* /*
* Use an explicitly specified extra_float_digits if it has been * Use an explicitly specified extra_float_digits if it has been provided.
* provided. Otherwise, set extra_float_digits so that we can dump float * Otherwise, set extra_float_digits so that we can dump float data
* data exactly (given correctly implemented float I/O code, anyway). * exactly (given correctly implemented float I/O code, anyway).
*/ */
if (have_extra_float_digits) if (have_extra_float_digits)
{ {
PQExpBuffer q = createPQExpBuffer(); PQExpBuffer q = createPQExpBuffer();
appendPQExpBuffer(q, "SET extra_float_digits TO %d", appendPQExpBuffer(q, "SET extra_float_digits TO %d",
extra_float_digits); extra_float_digits);
ExecuteSqlStatement(AH, q->data); ExecuteSqlStatement(AH, q->data);

View File

@ -1406,8 +1406,8 @@ expand_dbname_patterns(PGconn *conn,
/* /*
* The loop below runs multiple SELECTs, which might sometimes result in * The loop below runs multiple SELECTs, which might sometimes result in
* duplicate entries in the name list, but we don't care, since all * duplicate entries in the name list, but we don't care, since all we're
* we're going to do is test membership of the list. * going to do is test membership of the list.
*/ */
for (SimpleStringListCell *cell = patterns->head; cell; cell = cell->next) for (SimpleStringListCell *cell = patterns->head; cell; cell = cell->next)

View File

@ -140,11 +140,12 @@ get_control_data(ClusterInfo *cluster, bool live_check)
p++; /* remove ':' char */ p++; /* remove ':' char */
/* /*
* We checked earlier for a postmaster lock file, and if we found * We checked earlier for a postmaster lock file, and if we
* one, we tried to start/stop the server to replay the WAL. However, * found one, we tried to start/stop the server to replay the
* pg_ctl -m immediate doesn't leave a lock file, but does require * WAL. However, pg_ctl -m immediate doesn't leave a lock
* WAL replay, so we check here that the server was shut down cleanly, * file, but does require WAL replay, so we check here that
* from the controldata perspective. * the server was shut down cleanly, from the controldata
* perspective.
*/ */
/* remove leading spaces */ /* remove leading spaces */
while (*p == ' ') while (*p == ' ')

View File

@ -213,16 +213,16 @@ check_loadable_libraries(void)
{ {
/* /*
* In Postgres 9.0, Python 3 support was added, and to do that, a * In Postgres 9.0, Python 3 support was added, and to do that, a
* plpython2u language was created with library name plpython2.so as a * plpython2u language was created with library name plpython2.so
* symbolic link to plpython.so. In Postgres 9.1, only the * as a symbolic link to plpython.so. In Postgres 9.1, only the
* plpython2.so library was created, and both plpythonu and plpython2u * plpython2.so library was created, and both plpythonu and
* pointing to it. For this reason, any reference to library name * plpython2u pointing to it. For this reason, any reference to
* "plpython" in an old PG <= 9.1 cluster must look for "plpython2" in * library name "plpython" in an old PG <= 9.1 cluster must look
* the new cluster. * for "plpython2" in the new cluster.
* *
* For this case, we could check pg_pltemplate, but that only works * For this case, we could check pg_pltemplate, but that only
* for languages, and does not help with function shared objects, so * works for languages, and does not help with function shared
* we just do a general fix. * objects, so we just do a general fix.
*/ */
if (GET_MAJOR_VERSION(old_cluster.major_version) < 901 && if (GET_MAJOR_VERSION(old_cluster.major_version) < 901 &&
strcmp(lib, "$libdir/plpython") == 0) strcmp(lib, "$libdir/plpython") == 0)

View File

@ -422,8 +422,8 @@ typedef struct
/* /*
* Separate randomness for each thread. Each thread option uses its own * Separate randomness for each thread. Each thread option uses its own
* random state to make all of them independent of each other and therefore * random state to make all of them independent of each other and
* deterministic at the thread level. * therefore deterministic at the thread level.
*/ */
RandomState ts_choose_rs; /* random state for selecting a script */ RandomState ts_choose_rs; /* random state for selecting a script */
RandomState ts_throttle_rs; /* random state for transaction throttling */ RandomState ts_throttle_rs; /* random state for transaction throttling */

View File

@ -671,9 +671,9 @@ to_chars_df(const floating_decimal_64 v, const uint32 olength, char *const resul
else else
{ {
/* /*
* We can save some code later by pre-filling with zeros. We know * We can save some code later by pre-filling with zeros. We know that
* that there can be no more than 16 output digits in this form, * there can be no more than 16 output digits in this form, otherwise
* otherwise we would not choose fixed-point output. * we would not choose fixed-point output.
*/ */
Assert(exp < 16 && exp + olength <= 16); Assert(exp < 16 && exp + olength <= 16);
memset(result, '0', 16); memset(result, '0', 16);
@ -800,8 +800,8 @@ to_chars(floating_decimal_64 v, const bool sign, char *const result)
/* /*
* The thresholds for fixed-point output are chosen to match printf * The thresholds for fixed-point output are chosen to match printf
* defaults. Beware that both the code of to_chars_df and the value * defaults. Beware that both the code of to_chars_df and the value of
* of DOUBLE_SHORTEST_DECIMAL_LEN are sensitive to these thresholds. * DOUBLE_SHORTEST_DECIMAL_LEN are sensitive to these thresholds.
*/ */
if (exp >= -4 && exp < 15) if (exp >= -4 && exp < 15)
return to_chars_df(v, olength, result + index) + sign; return to_chars_df(v, olength, result + index) + sign;

View File

@ -481,10 +481,10 @@ to_chars_f(const floating_decimal_32 v, const uint32 olength, char *const result
else else
{ {
/* /*
* We can save some code later by pre-filling with zeros. We know * We can save some code later by pre-filling with zeros. We know that
* that there can be no more than 6 output digits in this form, * there can be no more than 6 output digits in this form, otherwise
* otherwise we would not choose fixed-point output. memset 8 * we would not choose fixed-point output. memset 8 rather than 6
* rather than 6 bytes to let the compiler optimize it. * bytes to let the compiler optimize it.
*/ */
Assert(exp < 6 && exp + olength <= 6); Assert(exp < 6 && exp + olength <= 6);
memset(result, '0', 8); memset(result, '0', 8);
@ -575,8 +575,8 @@ to_chars(const floating_decimal_32 v, const bool sign, char *const result)
/* /*
* The thresholds for fixed-point output are chosen to match printf * The thresholds for fixed-point output are chosen to match printf
* defaults. Beware that both the code of to_chars_f and the value * defaults. Beware that both the code of to_chars_f and the value of
* of FLOAT_SHORTEST_DECIMAL_LEN are sensitive to these thresholds. * FLOAT_SHORTEST_DECIMAL_LEN are sensitive to these thresholds.
*/ */
if (exp >= -4 && exp < 6) if (exp >= -4 && exp < 6)
return to_chars_f(v, olength, result + index) + sign; return to_chars_f(v, olength, result + index) + sign;

View File

@ -759,10 +759,9 @@ pglz_decompress(const char *source, int32 slen, char *dest,
} }
/* /*
* Check we decompressed the right amount. * Check we decompressed the right amount. If we are slicing, then we
* If we are slicing, then we won't necessarily * won't necessarily be at the end of the source or dest buffers when we
* be at the end of the source or dest buffers * hit a stop, so we don't test them.
* when we hit a stop, so we don't test them.
*/ */
if (check_complete && (dp != destend || sp != srcend)) if (check_complete && (dp != destend || sp != srcend))
return -1; return -1;

View File

@ -18,9 +18,10 @@
#include "lib/stringinfo.h" #include "lib/stringinfo.h"
#define XLOG_GIST_PAGE_UPDATE 0x00 #define XLOG_GIST_PAGE_UPDATE 0x00
#define XLOG_GIST_DELETE 0x10 /* delete leaf index tuples for a page */ #define XLOG_GIST_DELETE 0x10 /* delete leaf index tuples for a
#define XLOG_GIST_PAGE_REUSE 0x20 /* old page is about to be reused from * page */
* FSM */ #define XLOG_GIST_PAGE_REUSE 0x20 /* old page is about to be reused
* from FSM */
#define XLOG_GIST_PAGE_SPLIT 0x30 #define XLOG_GIST_PAGE_SPLIT 0x30
/* #define XLOG_GIST_INSERT_COMPLETE 0x40 */ /* not used anymore */ /* #define XLOG_GIST_INSERT_COMPLETE 0x40 */ /* not used anymore */
/* #define XLOG_GIST_CREATE_INDEX 0x50 */ /* not used anymore */ /* #define XLOG_GIST_CREATE_INDEX 0x50 */ /* not used anymore */
@ -83,7 +84,8 @@ typedef struct gistxlogPageSplit
typedef struct gistxlogPageDelete typedef struct gistxlogPageDelete
{ {
TransactionId deleteXid; /* last Xid which could see page in scan */ TransactionId deleteXid; /* last Xid which could see page in scan */
OffsetNumber downlinkOffset; /* Offset of downlink referencing this page */ OffsetNumber downlinkOffset; /* Offset of downlink referencing this
* page */
} gistxlogPageDelete; } gistxlogPageDelete;
#define SizeOfGistxlogPageDelete (offsetof(gistxlogPageDelete, downlinkOffset) + sizeof(OffsetNumber)) #define SizeOfGistxlogPageDelete (offsetof(gistxlogPageDelete, downlinkOffset) + sizeof(OffsetNumber))

View File

@ -575,10 +575,10 @@ typedef struct TableAmRoutine
/* /*
* This callback should return true if the relation requires a TOAST table * This callback should return true if the relation requires a TOAST table
* and false if it does not. It may wish to examine the relation's * and false if it does not. It may wish to examine the relation's tuple
* tuple descriptor before making a decision, but if it uses some other * descriptor before making a decision, but if it uses some other method
* method of storing large values (or if it does not support them) it can * of storing large values (or if it does not support them) it can simply
* simply return false. * return false.
*/ */
bool (*relation_needs_toast_table) (Relation rel); bool (*relation_needs_toast_table) (Relation rel);

View File

@ -136,7 +136,8 @@ typedef enum ObjectClass
#define PERFORM_DELETION_QUIETLY 0x0004 /* suppress notices */ #define PERFORM_DELETION_QUIETLY 0x0004 /* suppress notices */
#define PERFORM_DELETION_SKIP_ORIGINAL 0x0008 /* keep original obj */ #define PERFORM_DELETION_SKIP_ORIGINAL 0x0008 /* keep original obj */
#define PERFORM_DELETION_SKIP_EXTENSIONS 0x0010 /* keep extensions */ #define PERFORM_DELETION_SKIP_EXTENSIONS 0x0010 /* keep extensions */
#define PERFORM_DELETION_CONCURRENT_LOCK 0x0020 /* normal drop with concurrent lock mode */ #define PERFORM_DELETION_CONCURRENT_LOCK 0x0020 /* normal drop with
* concurrent lock mode */
/* in dependency.c */ /* in dependency.c */

View File

@ -34,7 +34,8 @@ CATALOG(pg_attrdef,2604,AttrDefaultRelationId)
int16 adnum; /* attnum of attribute */ int16 adnum; /* attnum of attribute */
#ifdef CATALOG_VARLEN /* variable-length fields start here */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
pg_node_tree adbin BKI_FORCE_NOT_NULL; /* nodeToString representation of default */ pg_node_tree adbin BKI_FORCE_NOT_NULL; /* nodeToString representation of
* default */
#endif #endif
} FormData_pg_attrdef; } FormData_pg_attrdef;

View File

@ -35,7 +35,8 @@ CATALOG(pg_default_acl,826,DefaultAclRelationId)
char defaclobjtype; /* see DEFACLOBJ_xxx constants below */ char defaclobjtype; /* see DEFACLOBJ_xxx constants below */
#ifdef CATALOG_VARLEN /* variable-length fields start here */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
aclitem defaclacl[1] BKI_FORCE_NOT_NULL; /* permissions to add at CREATE time */ aclitem defaclacl[1] BKI_FORCE_NOT_NULL; /* permissions to add at
* CREATE time */
#endif #endif
} FormData_pg_default_acl; } FormData_pg_default_acl;

View File

@ -35,7 +35,8 @@ CATALOG(pg_policy,3256,PolicyRelationId)
bool polpermissive; /* restrictive or permissive policy */ bool polpermissive; /* restrictive or permissive policy */
#ifdef CATALOG_VARLEN #ifdef CATALOG_VARLEN
Oid polroles[1] BKI_FORCE_NOT_NULL; /* Roles associated with policy */ Oid polroles[1] BKI_FORCE_NOT_NULL; /* Roles associated with
* policy */
pg_node_tree polqual; /* Policy quals. */ pg_node_tree polqual; /* Policy quals. */
pg_node_tree polwithcheck; /* WITH CHECK quals. */ pg_node_tree polwithcheck; /* WITH CHECK quals. */
#endif #endif

View File

@ -206,8 +206,8 @@ struct TupleTableSlotOps
HeapTuple (*copy_heap_tuple) (TupleTableSlot *slot); HeapTuple (*copy_heap_tuple) (TupleTableSlot *slot);
/* /*
* Return a copy of minimal tuple representing the contents of the slot. The * Return a copy of minimal tuple representing the contents of the slot.
* copy needs to be palloc'd in the current memory context. The slot * The copy needs to be palloc'd in the current memory context. The slot
* itself is expected to remain unaffected. It is *not* expected to have * itself is expected to remain unaffected. It is *not* expected to have
* meaningful "system columns" in the copy. The copy is not be "owned" by * meaningful "system columns" in the copy. The copy is not be "owned" by
* the slot i.e. the caller has to take responsibilty to free memory * the slot i.e. the caller has to take responsibilty to free memory

View File

@ -1114,7 +1114,7 @@ typedef struct ModifyTableState
int mt_nplans; /* number of plans in the array */ int mt_nplans; /* number of plans in the array */
int mt_whichplan; /* which one is being executed (0..n-1) */ int mt_whichplan; /* which one is being executed (0..n-1) */
TupleTableSlot **mt_scans; /* input tuple corresponding to underlying TupleTableSlot **mt_scans; /* input tuple corresponding to underlying
plans */ * plans */
ResultRelInfo *resultRelInfo; /* per-subplan target relations */ ResultRelInfo *resultRelInfo; /* per-subplan target relations */
ResultRelInfo *rootResultRelInfo; /* root target relation (partitioned ResultRelInfo *rootResultRelInfo; /* root target relation (partitioned
* table root) */ * table root) */

View File

@ -508,6 +508,7 @@ extern char *inet_net_ntop(int af, const void *src, int bits,
/* port/pg_strong_random.c */ /* port/pg_strong_random.c */
extern bool pg_strong_random(void *buf, size_t len); extern bool pg_strong_random(void *buf, size_t len);
/* /*
* pg_backend_random used to be a wrapper for pg_strong_random before * pg_backend_random used to be a wrapper for pg_strong_random before
* Postgres 12 for the backend code. * Postgres 12 for the backend code.

View File

@ -47,8 +47,8 @@ typedef struct LogicalDecodingContext
/* /*
* Marks the logical decoding context as fast forward decoding one. Such a * Marks the logical decoding context as fast forward decoding one. Such a
* context does not have plugin loaded so most of the following * context does not have plugin loaded so most of the following properties
* properties are unused. * are unused.
*/ */
bool fast_forward; bool fast_forward;

View File

@ -53,8 +53,8 @@ ECPGopen(const char *cursor_name,const char *prepared_name,
else else
{ {
/* /*
* If can't get the connection name by declared name then using connection name * If can't get the connection name by declared name then using
* coming from the parameter connection_name * connection name coming from the parameter connection_name
*/ */
real_connection_name = connection_name; real_connection_name = connection_name;
} }
@ -99,8 +99,8 @@ ECPGfetch(const char *cursor_name,
if (real_connection_name == NULL) if (real_connection_name == NULL)
{ {
/* /*
* If can't get the connection name by cursor name then using connection name * If can't get the connection name by cursor name then using
* coming from the parameter connection_name * connection name coming from the parameter connection_name
*/ */
real_connection_name = connection_name; real_connection_name = connection_name;
} }
@ -142,8 +142,8 @@ ECPGclose(const char *cursor_name,
if (real_connection_name == NULL) if (real_connection_name == NULL)
{ {
/* /*
* If can't get the connection name by cursor name then using connection name * If can't get the connection name by cursor name then using
* coming from the parameter connection_name * connection name coming from the parameter connection_name
*/ */
real_connection_name = connection_name; real_connection_name = connection_name;
} }

View File

@ -603,8 +603,7 @@ set_desc_attr(struct descriptor_item *desc_item, struct variable *var,
desc_item->data_len = variable->len; desc_item->data_len = variable->len;
} }
ecpg_free(desc_item->data); /* free() takes care of a ecpg_free(desc_item->data); /* free() takes care of a potential NULL value */
* potential NULL value */
desc_item->data = (char *) tobeinserted; desc_item->data = (char *) tobeinserted;
} }
@ -875,8 +874,8 @@ ECPGdescribe(int line, int compat, bool input, const char *connection_name, cons
if (real_connection_name == NULL) if (real_connection_name == NULL)
{ {
/* /*
* If can't get the connection name by declared name then using connection name * If can't get the connection name by declared name then using
* coming from the parameter connection_name * connection name coming from the parameter connection_name
*/ */
real_connection_name = connection_name; real_connection_name = connection_name;
} }

View File

@ -492,7 +492,8 @@ static char*
convert_bytea_to_string(char *from_data, int from_len, int lineno) convert_bytea_to_string(char *from_data, int from_len, int lineno)
{ {
char *to_data; char *to_data;
int to_len = ecpg_hex_enc_len(from_len) + 4 + 1; /* backslash + 'x' + quote + quote */ int to_len = ecpg_hex_enc_len(from_len) + 4 + 1; /* backslash + 'x' +
* quote + quote */
to_data = ecpg_alloc(to_len, lineno); to_data = ecpg_alloc(to_len, lineno);
if (!to_data) if (!to_data)
@ -1167,8 +1168,8 @@ store_input_from_desc(struct statement *stmt, struct descriptor_item *desc_item,
struct variable var; struct variable var;
/* /*
* In case of binary data, only allocate memory and memcpy because * In case of binary data, only allocate memory and memcpy because binary
* binary data have been already stored into desc_item->data with * data have been already stored into desc_item->data with
* ecpg_store_input() at ECPGset_desc(). * ecpg_store_input() at ECPGset_desc().
*/ */
if (desc_item->is_binary) if (desc_item->is_binary)
@ -1455,6 +1456,7 @@ ecpg_build_params(struct statement *stmt)
{ {
/* Add double quote both side for embedding statement name. */ /* Add double quote both side for embedding statement name. */
char *str = ecpg_alloc(strlen(tobeinserted) + 2 + 1, stmt->lineno); char *str = ecpg_alloc(strlen(tobeinserted) + 2 + 1, stmt->lineno);
sprintf(str, "\"%s\"", tobeinserted); sprintf(str, "\"%s\"", tobeinserted);
ecpg_free(tobeinserted); ecpg_free(tobeinserted);
tobeinserted = str; tobeinserted = str;
@ -1472,6 +1474,7 @@ ecpg_build_params(struct statement *stmt)
if (binary_format) if (binary_format)
{ {
char *p = convert_bytea_to_string(tobeinserted, binary_length, stmt->lineno); char *p = convert_bytea_to_string(tobeinserted, binary_length, stmt->lineno);
if (!p) if (!p)
{ {
ecpg_free_params(stmt, false); ecpg_free_params(stmt, false);
@ -1541,8 +1544,8 @@ ecpg_build_params(struct statement *stmt)
} }
/* /*
* Check if there are unmatched things left. * Check if there are unmatched things left. PREPARE AS has no parameter.
* PREPARE AS has no parameter. Check other statement. * Check other statement.
*/ */
if (stmt->statement_type != ECPGst_prepare && if (stmt->statement_type != ECPGst_prepare &&
next_insert(stmt->command, position, stmt->questionmarks, std_strings) >= 0) next_insert(stmt->command, position, stmt->questionmarks, std_strings) >= 0)
@ -2283,8 +2286,8 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
if (real_connection_name == NULL) if (real_connection_name == NULL)
{ {
/* /*
* If can't get the connection name by declared name then using connection name * If can't get the connection name by declared name then using
* coming from the parameter connection_name * connection name coming from the parameter connection_name
*/ */
real_connection_name = connection_name; real_connection_name = connection_name;
} }

View File

@ -239,8 +239,8 @@ ECPGprepare(int lineno, const char *connection_name, const bool questionmarks,
if (real_connection_name == NULL) if (real_connection_name == NULL)
{ {
/* /*
* If can't get the connection name by declared name then using connection name * If can't get the connection name by declared name then using
* coming from the parameter connection_name * connection name coming from the parameter connection_name
*/ */
real_connection_name = connection_name; real_connection_name = connection_name;
} }
@ -345,8 +345,8 @@ ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
if (real_connection_name == NULL) if (real_connection_name == NULL)
{ {
/* /*
* If can't get the connection name by declared name then using connection name * If can't get the connection name by declared name then using
* coming from the parameter connection_name * connection name coming from the parameter connection_name
*/ */
real_connection_name = connection_name; real_connection_name = connection_name;
} }
@ -408,8 +408,8 @@ ECPGprepared_statement(const char *connection_name, const char *name, int lineno
if (real_connection_name == NULL) if (real_connection_name == NULL)
{ {
/* /*
* If can't get the connection name by declared name then using connection name * If can't get the connection name by declared name then using
* coming from the parameter connection_name * connection name coming from the parameter connection_name
*/ */
real_connection_name = connection_name; real_connection_name = connection_name;
} }
@ -667,11 +667,11 @@ ECPGdeclare(int lineno, const char *connection_name, const char *name)
{ {
/* /*
* Going to here means not using AT clause in the DECLARE STATEMENT * Going to here means not using AT clause in the DECLARE STATEMENT
* ECPG pre-processor allows this case. * ECPG pre-processor allows this case. However, we don't allocate a
* However, we don't allocate a node to store the declared name * node to store the declared name because the DECLARE STATEMENT
* because the DECLARE STATEMENT without using AT clause will be ignored. * without using AT clause will be ignored. The following statement
* The following statement such as PREPARE, EXECUTE are executed * such as PREPARE, EXECUTE are executed as usual on the current
* as usual on the current connection. * connection.
*/ */
return true; return true;
} }
@ -682,7 +682,10 @@ ECPGdeclare(int lineno, const char *connection_name, const char *name)
if (ecpg_find_declared_statement(name)) if (ecpg_find_declared_statement(name))
{ {
/* Should not go to here because the pre-compiler has check the duplicate name */ /*
* Should not go to here because the pre-compiler has check the
* duplicate name
*/
return false; return false;
} }
@ -831,7 +834,10 @@ ecpg_release_declared_statement(const char *connection_name)
ecpg_free(cur->cursor_name); ecpg_free(cur->cursor_name);
ecpg_free(cur); ecpg_free(cur);
/* One connection can be used by multiple declared name, so no break here */ /*
* One connection can be used by multiple declared name, so no
* break here
*/
} }
else else
prev = cur; prev = cur;

View File

@ -121,8 +121,8 @@ free_argument(struct arguments *arg)
free_argument(arg->next); free_argument(arg->next);
/* /*
* Don't free variables in it because the original codes don't free it either * Don't free variables in it because the original codes don't free it
* variables are static structures instead of allocating * either variables are static structures instead of allocating
*/ */
free(arg); free(arg);
} }

View File

@ -142,9 +142,9 @@ output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
st = ECPGst_normal; st = ECPGst_normal;
/* /*
* In following cases, stmt is CSTRING or char_variable. They must be output directly. * In following cases, stmt is CSTRING or char_variable. They must be
* - prepared_name of EXECUTE without exprlist * output directly. - prepared_name of EXECUTE without exprlist -
* - execstring of EXECUTE IMMEDIATE * execstring of EXECUTE IMMEDIATE
*/ */
fprintf(base_yyout, "%s, ", ecpg_statement_type_name[st]); fprintf(base_yyout, "%s, ", ecpg_statement_type_name[st]);
if (st == ECPGst_execute || st == ECPGst_exec_immediate) if (st == ECPGst_execute || st == ECPGst_exec_immediate)

View File

@ -2420,6 +2420,7 @@ keep_going: /* We will come back to here until there is
getHostaddr(conn, host_addr, NI_MAXHOST); getHostaddr(conn, host_addr, NI_MAXHOST);
if (strlen(host_addr) > 0) if (strlen(host_addr) > 0)
conn->connip = strdup(host_addr); conn->connip = strdup(host_addr);
/* /*
* purposely ignore strdup failure; not a big problem if * purposely ignore strdup failure; not a big problem if
* it fails anyway. * it fails anyway.

View File

@ -36,6 +36,7 @@
/* All "broken" PQExpBuffers point to this string. */ /* All "broken" PQExpBuffers point to this string. */
static const char oom_buffer[1] = ""; static const char oom_buffer[1] = "";
/* Need a char * for unconstify() compatiblity */ /* Need a char * for unconstify() compatiblity */
static const char *oom_buffer_ptr = oom_buffer; static const char *oom_buffer_ptr = oom_buffer;

View File

@ -6895,8 +6895,8 @@ exec_move_row_from_fields(PLpgSQL_execstate *estate,
int strict_multiassignment_level = 0; int strict_multiassignment_level = 0;
/* /*
* The extra check strict strict_multi_assignment can be active, * The extra check strict strict_multi_assignment can be active, only when
* only when input tupdesc is specified. * input tupdesc is specified.
*/ */
if (tupdesc != NULL) if (tupdesc != NULL)
{ {
@ -7115,8 +7115,8 @@ exec_move_row_from_fields(PLpgSQL_execstate *estate,
} }
/* /*
* When strict_multiassignment extra check is active, ensure there * When strict_multiassignment extra check is active, ensure there are
* are no unassigned source attributes. * no unassigned source attributes.
*/ */
if (strict_multiassignment_level && anum < td_natts) if (strict_multiassignment_level && anum < td_natts)
{ {

View File

@ -753,8 +753,8 @@ PLy_trigger_build_args(FunctionCallInfo fcinfo, PLyProcedure *proc, HeapTuple *r
Py_DECREF(pltlevel); Py_DECREF(pltlevel);
/* /*
* Note: In BEFORE trigger, stored generated columns are not computed yet, * Note: In BEFORE trigger, stored generated columns are not
* so don't make them accessible in NEW row. * computed yet, so don't make them accessible in NEW row.
*/ */
if (TRIGGER_FIRED_BY_INSERT(tdata->tg_event)) if (TRIGGER_FIRED_BY_INSERT(tdata->tg_event))

View File

@ -1165,8 +1165,8 @@ pltcl_trigger_handler(PG_FUNCTION_ARGS, pltcl_call_state *call_state,
* Now the command part of the event for TG_op and data for NEW * Now the command part of the event for TG_op and data for NEW
* and OLD * and OLD
* *
* Note: In BEFORE trigger, stored generated columns are not computed yet, * Note: In BEFORE trigger, stored generated columns are not
* so don't make them accessible in NEW row. * computed yet, so don't make them accessible in NEW row.
*/ */
if (TRIGGER_FIRED_BY_INSERT(trigdata->tg_event)) if (TRIGGER_FIRED_BY_INSERT(trigdata->tg_event))
{ {

View File

@ -101,6 +101,7 @@ pg_strtof(const char *nptr, char **endptr)
* Try again. errno is already 0 here. * Try again. errno is already 0 here.
*/ */
double dresult = strtod(nptr, NULL); double dresult = strtod(nptr, NULL);
if (errno) if (errno)
{ {
/* On error, just return the error */ /* On error, just return the error */

View File

@ -112,6 +112,7 @@ ArchiveEntryPtrType
ArchiveFormat ArchiveFormat
ArchiveHandle ArchiveHandle
ArchiveMode ArchiveMode
ArchiveOpts
ArchiverOutput ArchiverOutput
ArchiverStage ArchiverStage
ArrayAnalyzeExtraData ArrayAnalyzeExtraData
@ -127,8 +128,6 @@ ArrayIterator
ArrayMapState ArrayMapState
ArrayMetaState ArrayMetaState
ArrayParseState ArrayParseState
ArrayRef
ArrayRefState
ArrayType ArrayType
AsyncQueueControl AsyncQueueControl
AsyncQueueEntry AsyncQueueEntry
@ -167,6 +166,8 @@ BTArrayKeyInfo
BTBuildState BTBuildState
BTCycleId BTCycleId
BTIndexStat BTIndexStat
BTInsertState
BTInsertStateData
BTLeader BTLeader
BTMetaPageData BTMetaPageData
BTOneVacInfo BTOneVacInfo
@ -176,6 +177,8 @@ BTPageOpaqueData
BTPageStat BTPageStat
BTPageState BTPageState
BTParallelScanDesc BTParallelScanDesc
BTScanInsert
BTScanInsertData
BTScanOpaque BTScanOpaque
BTScanOpaqueData BTScanOpaqueData
BTScanPos BTScanPos
@ -209,6 +212,7 @@ BeginSampleScan_function
BernoulliSamplerData BernoulliSamplerData
BgWorkerStartTime BgWorkerStartTime
BgwHandleStatus BgwHandleStatus
BinaryArithmFunc
BipartiteMatchState BipartiteMatchState
BitmapAnd BitmapAnd
BitmapAndPath BitmapAndPath
@ -272,6 +276,7 @@ BufferCachePagesContext
BufferCachePagesRec BufferCachePagesRec
BufferDesc BufferDesc
BufferDescPadded BufferDescPadded
BufferHeapTupleTableSlot
BufferLookupEnt BufferLookupEnt
BufferStrategyControl BufferStrategyControl
BufferTag BufferTag
@ -279,6 +284,7 @@ BufferUsage
BuildAccumulator BuildAccumulator
BuiltinScript BuiltinScript
BulkInsertState BulkInsertState
BulkInsertStateData
CACHESIGN CACHESIGN
CAC_state CAC_state
CCFastEqualFN CCFastEqualFN
@ -295,8 +301,10 @@ COP
CRITICAL_SECTION CRITICAL_SECTION
CRSSnapshotAction CRSSnapshotAction
CState CState
CTEMaterialize
CV CV
C_block C_block
CachedExpression
CachedPlan CachedPlan
CachedPlanSource CachedPlanSource
CallContext CallContext
@ -323,14 +331,13 @@ Chromosome
CkptSortItem CkptSortItem
CkptTsStatus CkptTsStatus
ClientAuthentication_hook_type ClientAuthentication_hook_type
ClientCertMode
ClientData ClientData
ClonePtrType ClonePtrType
ClonedConstraint
ClosePortalStmt ClosePortalStmt
ClosePtrType ClosePtrType
Clump Clump
ClusterInfo ClusterInfo
ClusterOption
ClusterStmt ClusterStmt
CmdType CmdType
CoalesceExpr CoalesceExpr
@ -505,6 +512,7 @@ DictSnowball
DictSubState DictSubState
DictSyn DictSyn
DictThesaurus DictThesaurus
DimensionInfo
DirectoryMethodData DirectoryMethodData
DirectoryMethodFile DirectoryMethodFile
DisableTimeoutParams DisableTimeoutParams
@ -655,7 +663,9 @@ FileFdwExecutionState
FileFdwPlanState FileFdwPlanState
FileNameMap FileNameMap
FileTag FileTag
FinalPathExtraData
FindSplitData FindSplitData
FindSplitStrat
FixedParallelExecutorState FixedParallelExecutorState
FixedParallelState FixedParallelState
FixedParamState FixedParamState
@ -807,6 +817,7 @@ FuncCandidateList
FuncDetailCode FuncDetailCode
FuncExpr FuncExpr
FuncInfo FuncInfo
FuncLookupError
Function Function
FunctionCallInfo FunctionCallInfo
FunctionCallInfoBaseData FunctionCallInfoBaseData
@ -853,7 +864,6 @@ GenerationChunk
GenerationContext GenerationContext
GenerationPointer GenerationPointer
GenericCosts GenericCosts
GenericIndexOpts
GenericXLogState GenericXLogState
GeqoPrivateData GeqoPrivateData
GetForeignJoinPaths_function GetForeignJoinPaths_function
@ -891,13 +901,14 @@ GinStatsData
GinTernaryValue GinTernaryValue
GinTupleCollector GinTupleCollector
GinVacuumState GinVacuumState
GistBDItem
GistBufferingMode GistBufferingMode
GistBulkDeleteResult
GistEntryVector GistEntryVector
GistInetKey GistInetKey
GistNSN GistNSN
GistSplitUnion GistSplitUnion
GistSplitVector GistSplitVector
GistVacState
GlobalTransaction GlobalTransaction
GrantRoleStmt GrantRoleStmt
GrantStmt GrantStmt
@ -905,6 +916,7 @@ GrantTargetType
Group Group
GroupPath GroupPath
GroupPathExtraData GroupPathExtraData
GroupResultPath
GroupState GroupState
GroupVarInfo GroupVarInfo
GroupingFunc GroupingFunc
@ -987,6 +999,7 @@ HeapTupleData
HeapTupleFields HeapTupleFields
HeapTupleHeader HeapTupleHeader
HeapTupleHeaderData HeapTupleHeaderData
HeapTupleTableSlot
HistControl HistControl
HotStandbyState HotStandbyState
I32 I32
@ -1020,6 +1033,7 @@ IndexBuildCallback
IndexBuildResult IndexBuildResult
IndexBulkDeleteCallback IndexBulkDeleteCallback
IndexBulkDeleteResult IndexBulkDeleteResult
IndexClause
IndexClauseSet IndexClauseSet
IndexElem IndexElem
IndexFetchHeapData IndexFetchHeapData
@ -1030,7 +1044,6 @@ IndexOnlyScan
IndexOnlyScanState IndexOnlyScanState
IndexOptInfo IndexOptInfo
IndexPath IndexPath
IndexQualInfo
IndexRuntimeKeyInfo IndexRuntimeKeyInfo
IndexScan IndexScan
IndexScanDesc IndexScanDesc
@ -1057,6 +1070,7 @@ Instrumentation
Int128AggState Int128AggState
Int8TransTypeData Int8TransTypeData
IntRBTreeNode IntRBTreeNode
IntegerSet
InternalDefaultACL InternalDefaultACL
InternalGrant InternalGrant
Interval Interval
@ -1065,6 +1079,7 @@ InvalidationChunk
InvalidationListHeader InvalidationListHeader
IpcMemoryId IpcMemoryId
IpcMemoryKey IpcMemoryKey
IpcMemoryState
IpcSemaphoreId IpcSemaphoreId
IpcSemaphoreKey IpcSemaphoreKey
IsForeignRelUpdatable_function IsForeignRelUpdatable_function
@ -1085,6 +1100,7 @@ JOBOBJECT_BASIC_LIMIT_INFORMATION
JOBOBJECT_BASIC_UI_RESTRICTIONS JOBOBJECT_BASIC_UI_RESTRICTIONS
JOBOBJECT_SECURITY_LIMIT_INFORMATION JOBOBJECT_SECURITY_LIMIT_INFORMATION
JitContext JitContext
JitInstrumentation
JitProviderCallbacks JitProviderCallbacks
JitProviderCompileExprCB JitProviderCompileExprCB
JitProviderInit JitProviderInit
@ -1120,9 +1136,11 @@ JsonPathGinPath
JsonPathGinPathItem JsonPathGinPathItem
JsonPathItem JsonPathItem
JsonPathItemType JsonPathItemType
JsonPathKeyword
JsonPathParseItem JsonPathParseItem
JsonPathParseResult JsonPathParseResult
JsonPathPredicateCallback JsonPathPredicateCallback
JsonPathString
JsonSemAction JsonSemAction
JsonTokenType JsonTokenType
JsonTransformStringValuesAction JsonTransformStringValuesAction
@ -1200,6 +1218,7 @@ LWLockMinimallyPadded
LWLockMode LWLockMode
LWLockPadded LWLockPadded
LabelProvider LabelProvider
LagTracker
LargeObjectDesc LargeObjectDesc
LastAttnumInfo LastAttnumInfo
Latch Latch
@ -1210,6 +1229,7 @@ LexemeHashKey
LexemeInfo LexemeInfo
LexemeKey LexemeKey
LexizeData LexizeData
LibraryInfo
Limit Limit
LimitPath LimitPath
LimitState LimitState
@ -1274,6 +1294,8 @@ LogicalTape
LogicalTapeSet LogicalTapeSet
MAGIC MAGIC
MBuf MBuf
MCVItem
MCVList
MEMORY_BASIC_INFORMATION MEMORY_BASIC_INFORMATION
MINIDUMPWRITEDUMP MINIDUMPWRITEDUMP
MINIDUMP_TYPE MINIDUMP_TYPE
@ -1308,8 +1330,8 @@ MinMaxExpr
MinMaxOp MinMaxOp
MinimalTuple MinimalTuple
MinimalTupleData MinimalTupleData
MinimalTupleTableSlot
MinmaxOpaque MinmaxOpaque
MissingPtr
ModifyTable ModifyTable
ModifyTablePath ModifyTablePath
ModifyTableState ModifyTableState
@ -1354,10 +1376,10 @@ NonEmptyRange
Notification Notification
NotifyStmt NotifyStmt
Nsrt Nsrt
NullableDatum
NullIfExpr NullIfExpr
NullTest NullTest
NullTestType NullTestType
NullableDatum
Numeric Numeric
NumericAggState NumericAggState
NumericDigit NumericDigit
@ -1379,6 +1401,7 @@ ObjectAccessPostAlter
ObjectAccessPostCreate ObjectAccessPostCreate
ObjectAccessType ObjectAccessType
ObjectAddress ObjectAddress
ObjectAddressAndFlags
ObjectAddressExtra ObjectAddressExtra
ObjectAddressStack ObjectAddressStack
ObjectAddresses ObjectAddresses
@ -1430,8 +1453,11 @@ PATH
PBOOL PBOOL
PCtxtHandle PCtxtHandle
PFN PFN
PGAlignedBlock
PGAlignedXLogBlock
PGAsyncStatusType PGAsyncStatusType
PGCALL2 PGCALL2
PGChecksummablePage
PGContextVisibility PGContextVisibility
PGEvent PGEvent
PGEventConnDestroy PGEventConnDestroy
@ -1610,7 +1636,6 @@ PTEntryArray
PTIterationArray PTIterationArray
PTOKEN_PRIVILEGES PTOKEN_PRIVILEGES
PTOKEN_USER PTOKEN_USER
PULONG
PUTENVPROC PUTENVPROC
PVOID PVOID
PX_Alias PX_Alias
@ -1629,7 +1654,6 @@ Pairs
ParallelAppendState ParallelAppendState
ParallelBitmapHeapState ParallelBitmapHeapState
ParallelBlockTableScanDesc ParallelBlockTableScanDesc
ParallelBlockTableScanDescData
ParallelCompletionPtr ParallelCompletionPtr
ParallelContext ParallelContext
ParallelExecutorInfo ParallelExecutorInfo
@ -1637,11 +1661,12 @@ ParallelHashGrowth
ParallelHashJoinBatch ParallelHashJoinBatch
ParallelHashJoinBatchAccessor ParallelHashJoinBatchAccessor
ParallelHashJoinState ParallelHashJoinState
ParallelTableScanDesc
ParallelTableScanDescData
ParallelIndexScanDesc ParallelIndexScanDesc
ParallelReadyList
ParallelSlot ParallelSlot
ParallelState ParallelState
ParallelTableScanDesc
ParallelTableScanDescData
ParallelWorkerContext ParallelWorkerContext
ParallelWorkerInfo ParallelWorkerInfo
Param Param
@ -1667,14 +1692,16 @@ ParserSetupHook
ParserState ParserState
PartClauseInfo PartClauseInfo
PartClauseMatchStatus PartClauseMatchStatus
PartClauseTarget
PartitionBoundInfo PartitionBoundInfo
PartitionBoundInfoData PartitionBoundInfoData
PartitionBoundSpec PartitionBoundSpec
PartitionCmd PartitionCmd
PartitionDesc PartitionDesc
PartitionDescData PartitionDescData
PartitionDirectory
PartitionDirectoryEntry
PartitionDispatch PartitionDispatch
PartitionDispatchData
PartitionElem PartitionElem
PartitionHashBound PartitionHashBound
PartitionKey PartitionKey
@ -1690,9 +1717,12 @@ PartitionPruningData
PartitionRangeBound PartitionRangeBound
PartitionRangeDatum PartitionRangeDatum
PartitionRangeDatumKind PartitionRangeDatumKind
PartitionRoutingInfo
PartitionScheme PartitionScheme
PartitionSpec PartitionSpec
PartitionTupleRouting PartitionTupleRouting
PartitionedRelPruneInfo
PartitionedRelPruningData
PartitionwiseAggregateType PartitionwiseAggregateType
PasswordType PasswordType
Path Path
@ -1712,6 +1742,7 @@ PerlInterpreter
Perl_check_t Perl_check_t
Perl_ppaddr_t Perl_ppaddr_t
Permutation Permutation
PgBackendGSSStatus
PgBackendSSLStatus PgBackendSSLStatus
PgBackendStatus PgBackendStatus
PgBenchExpr PgBenchExpr
@ -1726,6 +1757,7 @@ PgFdwAnalyzeState
PgFdwDirectModifyState PgFdwDirectModifyState
PgFdwModifyState PgFdwModifyState
PgFdwOption PgFdwOption
PgFdwPathExtraData
PgFdwRelationInfo PgFdwRelationInfo
PgFdwScanState PgFdwScanState
PgIfAddrCallback PgIfAddrCallback
@ -1741,6 +1773,7 @@ PgStat_MsgAnalyze
PgStat_MsgArchiver PgStat_MsgArchiver
PgStat_MsgAutovacStart PgStat_MsgAutovacStart
PgStat_MsgBgWriter PgStat_MsgBgWriter
PgStat_MsgChecksumFailure
PgStat_MsgDeadlock PgStat_MsgDeadlock
PgStat_MsgDropdb PgStat_MsgDropdb
PgStat_MsgDummy PgStat_MsgDummy
@ -1811,6 +1844,7 @@ PredXactList
PredXactListElement PredXactListElement
PredicateLockData PredicateLockData
PredicateLockTargetType PredicateLockTargetType
PrepParallelRestorePtrType
PrepareStmt PrepareStmt
PreparedParamsData PreparedParamsData
PreparedStatement PreparedStatement
@ -1869,6 +1903,7 @@ QPRS_STATE
QTN2QTState QTN2QTState
QTNode QTNode
QUERYTYPE QUERYTYPE
QUERY_SECURITY_CONTEXT_TOKEN_FN
QualCost QualCost
QualItem QualItem
Query Query
@ -1885,8 +1920,8 @@ QueryRepresentationOperand
QuerySource QuerySource
QueueBackendStatus QueueBackendStatus
QueuePosition QueuePosition
RBNode RBTNode
RBOrderControl RBTOrderControl
RBTree RBTree
RBTreeIterator RBTreeIterator
REPARSE_JUNCTION_DATA_BUFFER REPARSE_JUNCTION_DATA_BUFFER
@ -1899,6 +1934,7 @@ RI_QueryKey
RTEKind RTEKind
RWConflict RWConflict
RWConflictPoolHeader RWConflictPoolHeader
RandomState
Range Range
RangeBound RangeBound
RangeBox RangeBox
@ -1930,7 +1966,7 @@ RecordCacheEntry
RecordCompareData RecordCompareData
RecordIOData RecordIOData
RecoveryLockListsEntry RecoveryLockListsEntry
RecoveryTargetAction RecoveryTargetTimeLineGoal
RecoveryTargetType RecoveryTargetType
RectBox RectBox
RecursionContext RecursionContext
@ -1961,7 +1997,6 @@ Relation
RelationData RelationData
RelationPtr RelationPtr
RelationSyncEntry RelationSyncEntry
RelativeTime
RelcacheCallbackFunction RelcacheCallbackFunction
RelfilenodeMapEntry RelfilenodeMapEntry
RelfilenodeMapKey RelfilenodeMapKey
@ -2015,7 +2050,6 @@ RestoreOptions
RestorePass RestorePass
RestrictInfo RestrictInfo
Result Result
ResultPath
ResultRelInfo ResultRelInfo
ResultState ResultState
ReturnSetInfo ReturnSetInfo
@ -2099,8 +2133,8 @@ Scan
ScanDirection ScanDirection
ScanKey ScanKey
ScanKeyData ScanKeyData
ScanKeyword ScanKeywordHashFunc
ScanStackEntry ScanKeywordList
ScanState ScanState
ScanTypeControl ScanTypeControl
SchemaQuery SchemaQuery
@ -2111,12 +2145,15 @@ SecLabelStmt
SeenRelsEntry SeenRelsEntry
SelectStmt SelectStmt
Selectivity Selectivity
SemTPadded
SemiAntiJoinFactors SemiAntiJoinFactors
SeqScan SeqScan
SeqScanState SeqScanState
SeqTable SeqTable
SeqTableData SeqTableData
SerCommitSeqNo SerCommitSeqNo
SerializableXactHandle
SerializedActiveRelMaps
SerializedReindexState SerializedReindexState
SerializedSnapshotData SerializedSnapshotData
SerializedTransactionState SerializedTransactionState
@ -2137,6 +2174,7 @@ SetOperation
SetOperationStmt SetOperationStmt
SetToDefault SetToDefault
SetupWorkerPtrType SetupWorkerPtrType
ShDependObjectInfo
SharedBitmapState SharedBitmapState
SharedDependencyObjectType SharedDependencyObjectType
SharedDependencyType SharedDependencyType
@ -2150,6 +2188,7 @@ SharedInvalRelmapMsg
SharedInvalSmgrMsg SharedInvalSmgrMsg
SharedInvalSnapshotMsg SharedInvalSnapshotMsg
SharedInvalidationMessage SharedInvalidationMessage
SharedJitInstrumentation
SharedRecordTableEntry SharedRecordTableEntry
SharedRecordTableKey SharedRecordTableKey
SharedRecordTypmodRegistry SharedRecordTypmodRegistry
@ -2232,12 +2271,14 @@ SpGistPageOpaque
SpGistPageOpaqueData SpGistPageOpaqueData
SpGistScanOpaque SpGistScanOpaque
SpGistScanOpaqueData SpGistScanOpaqueData
SpGistSearchItem
SpGistState SpGistState
SpGistTypeDesc SpGistTypeDesc
SpecialJoinInfo SpecialJoinInfo
SpinDelayStatus SpinDelayStatus
SplitInterval SplitInterval
SplitLR SplitLR
SplitPoint
SplitVar SplitVar
SplitedPageLayout SplitedPageLayout
StackElem StackElem
@ -2273,16 +2314,23 @@ SubTransactionId
SubXactCallback SubXactCallback
SubXactCallbackItem SubXactCallbackItem
SubXactEvent SubXactEvent
SubplanResultRelHashElem
SubqueryScan SubqueryScan
SubqueryScanPath SubqueryScanPath
SubqueryScanState SubqueryScanState
SubscriptingRef
SubscriptingRefState
Subscription Subscription
SubscriptionInfo SubscriptionInfo
SubscriptionRelState SubscriptionRelState
SupportRequestCost
SupportRequestIndexCondition
SupportRequestRows
SupportRequestSelectivity
SupportRequestSimplify
Syn Syn
SyncOps SyncOps
SyncRepConfigData SyncRepConfigData
SyncRequestHandler
SyncRequestType SyncRequestType
SysScanDesc SysScanDesc
SyscacheCallbackFunction SyscacheCallbackFunction
@ -2336,7 +2384,6 @@ TSVectorParseState
TSVectorStat TSVectorStat
TState TState
TStoreState TStoreState
TTOffList
TYPCATEGORY TYPCATEGORY
T_Action T_Action
T_WorkerStatus T_WorkerStatus
@ -2383,8 +2430,6 @@ TidPath
TidScan TidScan
TidScanState TidScanState
TimeADT TimeADT
TimeInterval
TimeIntervalData
TimeLineHistoryCmd TimeLineHistoryCmd
TimeLineHistoryEntry TimeLineHistoryEntry
TimeLineID TimeLineID
@ -2479,6 +2524,8 @@ U32
U8 U8
UChar UChar
UCharIterator UCharIterator
UColAttribute
UColAttributeValue
UCollator UCollator
UConverter UConverter
UErrorCode UErrorCode
@ -2503,6 +2550,7 @@ UserMapping
UserOpts UserOpts
VacAttrStats VacAttrStats
VacAttrStatsP VacAttrStatsP
VacOptTernaryValue
VacuumParams VacuumParams
VacuumRelation VacuumRelation
VacuumStmt VacuumStmt
@ -2532,6 +2580,7 @@ ViewCheckOption
ViewOptions ViewOptions
ViewStmt ViewStmt
VirtualTransactionId VirtualTransactionId
VirtualTupleTableSlot
Vsrt Vsrt
WAITORTIMERCALLBACK WAITORTIMERCALLBACK
WAIT_ORDER WAIT_ORDER
@ -2576,6 +2625,7 @@ WindowAgg
WindowAggPath WindowAggPath
WindowAggState WindowAggState
WindowClause WindowClause
WindowClauseSortData
WindowDef WindowDef
WindowFunc WindowFunc
WindowFuncExprState WindowFuncExprState
@ -2638,6 +2688,7 @@ XLogSource
XLogwrtResult XLogwrtResult
XLogwrtRqst XLogwrtRqst
XPVIV XPVIV
XPVMG
XactCallback XactCallback
XactCallbackItem XactCallbackItem
XactEvent XactEvent
@ -2652,8 +2703,6 @@ XmlTableBuilderData
YYLTYPE YYLTYPE
YYSTYPE YYSTYPE
YY_BUFFER_STATE YY_BUFFER_STATE
ZipfCache
ZipfCell
_SPI_connection _SPI_connection
_SPI_plan _SPI_plan
__AssignProcessToJobObject __AssignProcessToJobObject
@ -2672,6 +2721,7 @@ allocfunc
ambeginscan_function ambeginscan_function
ambuild_function ambuild_function
ambuildempty_function ambuildempty_function
ambuildphasename_function
ambulkdelete_function ambulkdelete_function
amcanreturn_function amcanreturn_function
amcostestimate_function amcostestimate_function
@ -2709,7 +2759,6 @@ bits16
bits32 bits32
bits8 bits8
bloom_filter bloom_filter
boolean
brin_column_state brin_column_state
bytea bytea
cached_re_str cached_re_str
@ -2810,6 +2859,7 @@ file_entry_t
file_type_t file_type_t
filemap_t filemap_t
finalize_primnode_context finalize_primnode_context
find_dependent_phvs_context
find_expr_references_context find_expr_references_context
fix_join_expr_context fix_join_expr_context
fix_scan_expr_context fix_scan_expr_context
@ -2819,6 +2869,8 @@ float4
float4KEY float4KEY
float8 float8
float8KEY float8KEY
floating_decimal_32
floating_decimal_64
fmAggrefPtr fmAggrefPtr
fmExprContextCallbackFunction fmExprContextCallbackFunction
fmNodePtr fmNodePtr
@ -2857,13 +2909,14 @@ ginxlogRecompressDataLeaf
ginxlogSplit ginxlogSplit
ginxlogUpdateMeta ginxlogUpdateMeta
ginxlogVacuumDataLeafPage ginxlogVacuumDataLeafPage
gistxlogDelete
gistxlogPage gistxlogPage
gistxlogPageDelete
gistxlogPageReuse
gistxlogPageSplit gistxlogPageSplit
gistxlogPageUpdate gistxlogPageUpdate
grouping_sets_data grouping_sets_data
gseg_picksplit_item gseg_picksplit_item
gss_OID
gss_OID_desc
gss_buffer_desc gss_buffer_desc
gss_cred_id_t gss_cred_id_t
gss_ctx_id_t gss_ctx_id_t
@ -2889,6 +2942,7 @@ inet
inetKEY inetKEY
inet_struct inet_struct
init_function init_function
inline_cte_walker_context
inline_error_callback_arg inline_error_callback_arg
ino_t ino_t
inquiry inquiry
@ -2905,6 +2959,9 @@ int64KEY
int8 int8
internalPQconninfoOption internalPQconninfoOption
intptr_t intptr_t
intset_internal_node
intset_leaf_node
intset_node
intvKEY intvKEY
itemIdSort itemIdSort
itemIdSortData itemIdSortData
@ -2920,6 +2977,7 @@ key_t
lclContext lclContext
lclTocEntry lclTocEntry
leafSegmentInfo leafSegmentInfo
leaf_item
line_t line_t
lineno_t lineno_t
list_qsort_comparator list_qsort_comparator
@ -2959,6 +3017,8 @@ mp_int
mp_result mp_result
mp_sign mp_sign
mp_size mp_size
mp_small
mp_usmall
mp_word mp_word
mpz_t mpz_t
mxact mxact
@ -3094,10 +3154,10 @@ radius_attribute
radius_packet radius_packet
rangeTableEntry_used_context rangeTableEntry_used_context
rank_context rank_context
rb_allocfunc rbt_allocfunc
rb_combiner rbt_combiner
rb_comparator rbt_comparator
rb_freefunc rbt_freefunc
reduce_outer_joins_state reduce_outer_joins_state
reference reference
regex_arc_t regex_arc_t
@ -3154,7 +3214,7 @@ slist_iter
slist_mutable_iter slist_mutable_iter
slist_node slist_node
slock_t slock_t
smgrid socket_set
spgBulkDeleteState spgBulkDeleteState
spgChooseIn spgChooseIn
spgChooseOut spgChooseOut
@ -3196,7 +3256,7 @@ stream_stop_callback
string string
substitute_actual_parameters_context substitute_actual_parameters_context
substitute_actual_srf_parameters_context substitute_actual_srf_parameters_context
substitute_multiple_relids_context substitute_phv_relids_context
svtype svtype
symbol symbol
tablespaceinfo tablespaceinfo
@ -3205,6 +3265,7 @@ teSection
temp_tablespaces_extra temp_tablespaces_extra
test_function test_function
test_shm_mq_header test_shm_mq_header
test_spec
text text
timeKEY timeKEY
time_t time_t
@ -3277,6 +3338,7 @@ walrcv_identify_system_fn
walrcv_readtimelinehistoryfile_fn walrcv_readtimelinehistoryfile_fn
walrcv_receive_fn walrcv_receive_fn
walrcv_send_fn walrcv_send_fn
walrcv_server_version_fn
walrcv_startstreaming_fn walrcv_startstreaming_fn
wchar2mb_with_len_converter wchar2mb_with_len_converter
wchar_t wchar_t