diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/executor/execExpr.c | 9 | ||||
-rw-r--r-- | src/backend/replication/logical/relation.c | 4 | ||||
-rw-r--r-- | src/backend/replication/logical/tablesync.c | 6 | ||||
-rw-r--r-- | src/backend/replication/pgoutput/pgoutput.c | 7 |
4 files changed, 10 insertions, 16 deletions
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c index cd41522b6b2..91df2009bee 100644 --- a/src/backend/executor/execExpr.c +++ b/src/backend/executor/execExpr.c @@ -216,7 +216,6 @@ ExecInitQual(List *qual, PlanState *parent) ExprState *state; ExprEvalStep scratch = {0}; List *adjust_jumps = NIL; - ListCell *lc; /* short-circuit (here and in ExecQual) for empty restriction list */ if (qual == NIL) @@ -250,10 +249,8 @@ ExecInitQual(List *qual, PlanState *parent) scratch.resvalue = &state->resvalue; scratch.resnull = &state->resnull; - foreach(lc, qual) + foreach_ptr(Expr, node, qual) { - Expr *node = (Expr *) lfirst(lc); - /* first evaluate expression */ ExecInitExprRec(node, state, &state->resvalue, &state->resnull); @@ -265,9 +262,9 @@ ExecInitQual(List *qual, PlanState *parent) } /* adjust jump targets */ - foreach(lc, adjust_jumps) + foreach_int(jump, adjust_jumps) { - ExprEvalStep *as = &state->steps[lfirst_int(lc)]; + ExprEvalStep *as = &state->steps[jump]; Assert(as->opcode == EEOP_QUAL); Assert(as->d.qualexpr.jumpdone == -1); diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c index 136e2532578..c68e8cfab7a 100644 --- a/src/backend/replication/logical/relation.c +++ b/src/backend/replication/logical/relation.c @@ -746,11 +746,9 @@ static Oid FindUsableIndexForReplicaIdentityFull(Relation localrel, AttrMap *attrmap) { List *idxlist = RelationGetIndexList(localrel); - ListCell *lc; - foreach(lc, idxlist) + foreach_oid(idxoid, idxlist) { - Oid idxoid = lfirst_oid(lc); bool isUsableIdx; Relation idxRel; IndexInfo *idxInfo; diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c index e8cc9ac5522..06d5b3df33a 100644 --- a/src/backend/replication/logical/tablesync.c +++ b/src/backend/replication/logical/tablesync.c @@ -1036,11 +1036,11 @@ fetch_remote_table_info(char *nspname, char *relname, /* Build the pubname list. */ initStringInfo(&pub_names); - foreach(lc, MySubscription->publications) + foreach_node(String, pubstr, MySubscription->publications) { - char *pubname = strVal(lfirst(lc)); + char *pubname = strVal(pubstr); - if (foreach_current_index(lc) > 0) + if (foreach_current_index(pubstr) > 0) appendStringInfoString(&pub_names, ", "); appendStringInfoString(&pub_names, quote_literal_cstr(pubname)); diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c index 1d0ed5c36f7..425238187f6 100644 --- a/src/backend/replication/pgoutput/pgoutput.c +++ b/src/backend/replication/pgoutput/pgoutput.c @@ -2234,7 +2234,6 @@ cleanup_rel_sync_cache(TransactionId xid, bool is_commit) { HASH_SEQ_STATUS hash_seq; RelationSyncEntry *entry; - ListCell *lc; Assert(RelationSyncCache != NULL); @@ -2247,15 +2246,15 @@ cleanup_rel_sync_cache(TransactionId xid, bool is_commit) * corresponding schema and we don't need to send it unless there is * any invalidation for that relation. */ - foreach(lc, entry->streamed_txns) + foreach_xid(streamed_txn, entry->streamed_txns) { - if (xid == lfirst_xid(lc)) + if (xid == streamed_txn) { if (is_commit) entry->schema_sent = true; entry->streamed_txns = - foreach_delete_current(entry->streamed_txns, lc); + foreach_delete_current(entry->streamed_txns, streamed_txn); break; } } |