Skip to content

Commit 0e4132a

Browse files
authored
Merge pull request #151 from postgres/master
Sync Fork from Upstream Repo
2 parents e8e8164 + d9d0762 commit 0e4132a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+398
-424
lines changed

contrib/amcheck/verify_nbtree.c

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,8 +1078,7 @@ bt_target_page_check(BtreeCheckState *state)
10781078
state->targetblock,
10791079
BTreeTupleGetNAtts(itup, state->rel),
10801080
P_ISLEAF(topaque) ? "heap" : "index",
1081-
(uint32) (state->targetlsn >> 32),
1082-
(uint32) state->targetlsn)));
1081+
LSN_FORMAT_ARGS(state->targetlsn))));
10831082
}
10841083
}
10851084

@@ -1120,8 +1119,7 @@ bt_target_page_check(BtreeCheckState *state)
11201119
errdetail_internal("Index tid=(%u,%u) tuple size=%zu lp_len=%u page lsn=%X/%X.",
11211120
state->targetblock, offset,
11221121
tupsize, ItemIdGetLength(itemid),
1123-
(uint32) (state->targetlsn >> 32),
1124-
(uint32) state->targetlsn),
1122+
LSN_FORMAT_ARGS(state->targetlsn)),
11251123
errhint("This could be a torn page problem.")));
11261124

11271125
/* Check the number of index tuple attributes */
@@ -1147,8 +1145,7 @@ bt_target_page_check(BtreeCheckState *state)
11471145
BTreeTupleGetNAtts(itup, state->rel),
11481146
P_ISLEAF(topaque) ? "heap" : "index",
11491147
htid,
1150-
(uint32) (state->targetlsn >> 32),
1151-
(uint32) state->targetlsn)));
1148+
LSN_FORMAT_ARGS(state->targetlsn))));
11521149
}
11531150

11541151
/*
@@ -1195,8 +1192,7 @@ bt_target_page_check(BtreeCheckState *state)
11951192
RelationGetRelationName(state->rel)),
11961193
errdetail_internal("Index tid=%s points to heap tid=%s page lsn=%X/%X.",
11971194
itid, htid,
1198-
(uint32) (state->targetlsn >> 32),
1199-
(uint32) state->targetlsn)));
1195+
LSN_FORMAT_ARGS(state->targetlsn))));
12001196
}
12011197

12021198
/*
@@ -1225,8 +1221,7 @@ bt_target_page_check(BtreeCheckState *state)
12251221
RelationGetRelationName(state->rel)),
12261222
errdetail_internal("Index tid=%s posting list offset=%d page lsn=%X/%X.",
12271223
itid, i,
1228-
(uint32) (state->targetlsn >> 32),
1229-
(uint32) state->targetlsn)));
1224+
LSN_FORMAT_ARGS(state->targetlsn))));
12301225
}
12311226

12321227
ItemPointerCopy(current, &last);
@@ -1282,8 +1277,7 @@ bt_target_page_check(BtreeCheckState *state)
12821277
itid,
12831278
P_ISLEAF(topaque) ? "heap" : "index",
12841279
htid,
1285-
(uint32) (state->targetlsn >> 32),
1286-
(uint32) state->targetlsn)));
1280+
LSN_FORMAT_ARGS(state->targetlsn))));
12871281
}
12881282

12891283
/* Fingerprint leaf page tuples (those that point to the heap) */
@@ -1390,8 +1384,7 @@ bt_target_page_check(BtreeCheckState *state)
13901384
itid,
13911385
P_ISLEAF(topaque) ? "heap" : "index",
13921386
htid,
1393-
(uint32) (state->targetlsn >> 32),
1394-
(uint32) state->targetlsn)));
1387+
LSN_FORMAT_ARGS(state->targetlsn))));
13951388
}
13961389
/* Reset, in case scantid was set to (itup) posting tuple's max TID */
13971390
skey->scantid = scantid;
@@ -1442,8 +1435,7 @@ bt_target_page_check(BtreeCheckState *state)
14421435
nitid,
14431436
P_ISLEAF(topaque) ? "heap" : "index",
14441437
nhtid,
1445-
(uint32) (state->targetlsn >> 32),
1446-
(uint32) state->targetlsn)));
1438+
LSN_FORMAT_ARGS(state->targetlsn))));
14471439
}
14481440

14491441
/*
@@ -1500,8 +1492,7 @@ bt_target_page_check(BtreeCheckState *state)
15001492
RelationGetRelationName(state->rel)),
15011493
errdetail_internal("Last item on page tid=(%u,%u) page lsn=%X/%X.",
15021494
state->targetblock, offset,
1503-
(uint32) (state->targetlsn >> 32),
1504-
(uint32) state->targetlsn)));
1495+
LSN_FORMAT_ARGS(state->targetlsn))));
15051496
}
15061497
}
15071498

@@ -1907,8 +1898,7 @@ bt_child_highkey_check(BtreeCheckState *state,
19071898
RelationGetRelationName(state->rel)),
19081899
errdetail_internal("Target block=%u child block=%u target page lsn=%X/%X.",
19091900
state->targetblock, blkno,
1910-
(uint32) (state->targetlsn >> 32),
1911-
(uint32) state->targetlsn)));
1901+
LSN_FORMAT_ARGS(state->targetlsn))));
19121902

19131903
/* Check level for non-ignorable page */
19141904
if (!P_IGNORE(opaque) && opaque->btpo.level != target_level - 1)
@@ -1993,8 +1983,7 @@ bt_child_highkey_check(BtreeCheckState *state,
19931983
RelationGetRelationName(state->rel)),
19941984
errdetail_internal("Target block=%u child block=%u target page lsn=%X/%X.",
19951985
state->targetblock, blkno,
1996-
(uint32) (state->targetlsn >> 32),
1997-
(uint32) state->targetlsn)));
1986+
LSN_FORMAT_ARGS(state->targetlsn))));
19981987
pivotkey_offset = P_HIKEY;
19991988
}
20001989
itemid = PageGetItemIdCareful(state, state->targetblock,
@@ -2024,8 +2013,7 @@ bt_child_highkey_check(BtreeCheckState *state,
20242013
RelationGetRelationName(state->rel)),
20252014
errdetail_internal("Target block=%u child block=%u target page lsn=%X/%X.",
20262015
state->targetblock, blkno,
2027-
(uint32) (state->targetlsn >> 32),
2028-
(uint32) state->targetlsn)));
2016+
LSN_FORMAT_ARGS(state->targetlsn))));
20292017
itup = state->lowkey;
20302018
}
20312019

@@ -2037,8 +2025,7 @@ bt_child_highkey_check(BtreeCheckState *state,
20372025
RelationGetRelationName(state->rel)),
20382026
errdetail_internal("Target block=%u child block=%u target page lsn=%X/%X.",
20392027
state->targetblock, blkno,
2040-
(uint32) (state->targetlsn >> 32),
2041-
(uint32) state->targetlsn)));
2028+
LSN_FORMAT_ARGS(state->targetlsn))));
20422029
}
20432030
}
20442031

@@ -2178,8 +2165,7 @@ bt_child_check(BtreeCheckState *state, BTScanInsert targetkey,
21782165
RelationGetRelationName(state->rel)),
21792166
errdetail_internal("Parent block=%u child block=%u parent page lsn=%X/%X.",
21802167
state->targetblock, childblock,
2181-
(uint32) (state->targetlsn >> 32),
2182-
(uint32) state->targetlsn)));
2168+
LSN_FORMAT_ARGS(state->targetlsn))));
21832169

21842170
for (offset = P_FIRSTDATAKEY(copaque);
21852171
offset <= maxoffset;
@@ -2220,8 +2206,7 @@ bt_child_check(BtreeCheckState *state, BTScanInsert targetkey,
22202206
RelationGetRelationName(state->rel)),
22212207
errdetail_internal("Parent block=%u child index tid=(%u,%u) parent page lsn=%X/%X.",
22222208
state->targetblock, childblock, offset,
2223-
(uint32) (state->targetlsn >> 32),
2224-
(uint32) state->targetlsn)));
2209+
LSN_FORMAT_ARGS(state->targetlsn))));
22252210
}
22262211

22272212
pfree(child);
@@ -2292,8 +2277,7 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
22922277
errdetail_internal("Block=%u level=%u left sibling=%u page lsn=%X/%X.",
22932278
blkno, opaque->btpo.level,
22942279
opaque->btpo_prev,
2295-
(uint32) (pagelsn >> 32),
2296-
(uint32) pagelsn)));
2280+
LSN_FORMAT_ARGS(pagelsn))));
22972281
return;
22982282
}
22992283

@@ -2314,8 +2298,7 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
23142298
RelationGetRelationName(state->rel)),
23152299
errdetail_internal("Block=%u page lsn=%X/%X.",
23162300
blkno,
2317-
(uint32) (pagelsn >> 32),
2318-
(uint32) pagelsn)));
2301+
LSN_FORMAT_ARGS(pagelsn))));
23192302

23202303
/* Descend from the given page, which is an internal page */
23212304
elog(DEBUG1, "checking for interrupted multi-level deletion due to missing downlink in index \"%s\"",
@@ -2381,8 +2364,7 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
23812364
RelationGetRelationName(state->rel)),
23822365
errdetail_internal("Top parent/target block=%u leaf block=%u top parent/under check lsn=%X/%X.",
23832366
blkno, childblk,
2384-
(uint32) (pagelsn >> 32),
2385-
(uint32) pagelsn)));
2367+
LSN_FORMAT_ARGS(pagelsn))));
23862368

23872369
/*
23882370
* Iff leaf page is half-dead, its high key top parent link should point
@@ -2408,8 +2390,7 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
24082390
RelationGetRelationName(state->rel)),
24092391
errdetail_internal("Block=%u level=%u page lsn=%X/%X.",
24102392
blkno, opaque->btpo.level,
2411-
(uint32) (pagelsn >> 32),
2412-
(uint32) pagelsn)));
2393+
LSN_FORMAT_ARGS(pagelsn))));
24132394
}
24142395

24152396
/*

contrib/pageinspect/rawpage.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,7 @@ page_header(PG_FUNCTION_ARGS)
309309
{
310310
char lsnchar[64];
311311

312-
snprintf(lsnchar, sizeof(lsnchar), "%X/%X",
313-
(uint32) (lsn >> 32), (uint32) lsn);
312+
snprintf(lsnchar, sizeof(lsnchar), "%X/%X", LSN_FORMAT_ARGS(lsn));
314313
values[0] = CStringGetTextDatum(lsnchar);
315314
}
316315
else

doc/src/sgml/client-auth.sgml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,10 @@ hostnogssenc <replaceable>database</replaceable> <replaceable>user</replaceabl
229229
members of the role, directly or indirectly, and not just by
230230
virtue of being a superuser.
231231
The value <literal>replication</literal> specifies that the record
232-
matches if a physical replication connection is requested (note that
233-
replication connections do not specify any particular database).
232+
matches if a physical replication connection is requested, however, it
233+
doesn't match with logical replication connections. Note that physical
234+
replication connections do not specify any particular database whereas
235+
logical replication connections do specify it.
234236
Otherwise, this is the name of
235237
a specific <productname>PostgreSQL</productname> database.
236238
Multiple database names can be supplied by separating them with

doc/src/sgml/func.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26227,14 +26227,14 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
2622726227
<row>
2622826228
<entry role="func_table_entry"><para role="func_signature">
2622926229
<indexterm>
26230-
<primary>pg_collation_actual_version</primary>
26230+
<primary>pg_collation_current_version</primary>
2623126231
</indexterm>
26232-
<function>pg_collation_actual_version</function> ( <type>oid</type> )
26232+
<function>pg_collation_current_version</function> ( <type>oid</type> )
2623326233
<returnvalue>text</returnvalue>
2623426234
</para>
2623526235
<para>
26236-
Returns the actual version of the collation object as it is currently
26237-
installed in the operating system. <literal>null</literal> is returned
26236+
Returns the version of the collation object as reported by the ICU
26237+
library or operating system. <literal>null</literal> is returned
2623826238
on operating systems where <productname>PostgreSQL</productname>
2623926239
doesn't have support for versions.
2624026240
</para></entry>

doc/src/sgml/ref/create_index.sgml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,8 @@ Indexes:
855855
Like any long-running transaction, <command>CREATE INDEX</command> on a
856856
table can affect which tuples can be removed by concurrent
857857
<command>VACUUM</command> on any other table.
858+
Excepted from this are operations with the <literal>CONCURRENTLY</literal>
859+
option for indexes that are not partial and do not index any expressions.
858860
</para>
859861

860862
<para>

doc/src/sgml/ref/reindex.sgml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ Indexes:
478478
Like any long-running transaction, <command>REINDEX</command> on a table
479479
can affect which tuples can be removed by concurrent
480480
<command>VACUUM</command> on any other table.
481+
Excepted from this are operations with the <literal>CONCURRENTLY</literal>
482+
option for indexes that are not partial and do not index any expressions.
481483
</para>
482484

483485
<para>

doc/src/sgml/stylesheet.xsl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
<xsl:choose>
2525
<xsl:when test="$website.stylesheet = 0">stylesheet.css</xsl:when>
2626
<xsl:otherwise>
27-
https://www.postgresql.org/media/css/fontawesome.css
28-
https://www.postgresql.org/media/css/bootstrap.min.css
29-
https://www.postgresql.org/media/css/main.css
30-
https://www.postgresql.org/media/css/normalize.css
27+
https://www.postgresql.org/media/css/docs-complete.css
3128
</xsl:otherwise>
3229
</xsl:choose>
3330
</xsl:param>

src/backend/access/heap/heapam.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,8 +2769,7 @@ heap_delete(Relation relation, ItemPointer tid,
27692769
HEAP_XMAX_IS_LOCKED_ONLY(tp.t_data->t_infomask) ||
27702770
HeapTupleHeaderIsOnlyLocked(tp.t_data))
27712771
result = TM_Ok;
2772-
else if (!ItemPointerEquals(&tp.t_self, &tp.t_data->t_ctid) ||
2773-
HeapTupleHeaderIndicatesMovedPartitions(tp.t_data))
2772+
else if (!ItemPointerEquals(&tp.t_self, &tp.t_data->t_ctid))
27742773
result = TM_Updated;
27752774
else
27762775
result = TM_Deleted;
@@ -3399,8 +3398,7 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
33993398

34003399
if (can_continue)
34013400
result = TM_Ok;
3402-
else if (!ItemPointerEquals(&oldtup.t_self, &oldtup.t_data->t_ctid) ||
3403-
HeapTupleHeaderIndicatesMovedPartitions(oldtup.t_data))
3401+
else if (!ItemPointerEquals(&oldtup.t_self, &oldtup.t_data->t_ctid))
34043402
result = TM_Updated;
34053403
else
34063404
result = TM_Deleted;
@@ -4636,8 +4634,7 @@ heap_lock_tuple(Relation relation, HeapTuple tuple,
46364634
HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_data->t_infomask) ||
46374635
HeapTupleHeaderIsOnlyLocked(tuple->t_data))
46384636
result = TM_Ok;
4639-
else if (!ItemPointerEquals(&tuple->t_self, &tuple->t_data->t_ctid) ||
4640-
HeapTupleHeaderIndicatesMovedPartitions(tuple->t_data))
4637+
else if (!ItemPointerEquals(&tuple->t_self, &tuple->t_data->t_ctid))
46414638
result = TM_Updated;
46424639
else
46434640
result = TM_Deleted;
@@ -5210,8 +5207,7 @@ test_lockmode_for_conflict(MultiXactStatus status, TransactionId xid,
52105207
LOCKMODE_from_mxstatus(wantedstatus)))
52115208
{
52125209
/* bummer */
5213-
if (!ItemPointerEquals(&tup->t_self, &tup->t_data->t_ctid) ||
5214-
HeapTupleHeaderIndicatesMovedPartitions(tup->t_data))
5210+
if (!ItemPointerEquals(&tup->t_self, &tup->t_data->t_ctid))
52155211
return TM_Updated;
52165212
else
52175213
return TM_Deleted;

src/backend/access/heap/heapam_visibility.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,7 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
607607
{
608608
if (HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_infomask))
609609
return TM_Ok;
610-
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid) ||
611-
HeapTupleHeaderIndicatesMovedPartitions(tuple))
610+
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid))
612611
return TM_Updated; /* updated by other */
613612
else
614613
return TM_Deleted; /* deleted by other */
@@ -653,8 +652,7 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
653652

654653
if (TransactionIdDidCommit(xmax))
655654
{
656-
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid) ||
657-
HeapTupleHeaderIndicatesMovedPartitions(tuple))
655+
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid))
658656
return TM_Updated;
659657
else
660658
return TM_Deleted;
@@ -714,8 +712,7 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
714712

715713
SetHintBits(tuple, buffer, HEAP_XMAX_COMMITTED,
716714
HeapTupleHeaderGetRawXmax(tuple));
717-
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid) ||
718-
HeapTupleHeaderIndicatesMovedPartitions(tuple))
715+
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid))
719716
return TM_Updated; /* updated by other */
720717
else
721718
return TM_Deleted; /* deleted by other */

src/backend/access/heap/rewriteheap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -997,8 +997,7 @@ logical_rewrite_log_mapping(RewriteState state, TransactionId xid,
997997
snprintf(path, MAXPGPATH,
998998
"pg_logical/mappings/" LOGICAL_REWRITE_FORMAT,
999999
dboid, relid,
1000-
(uint32) (state->rs_begin_lsn >> 32),
1001-
(uint32) state->rs_begin_lsn,
1000+
LSN_FORMAT_ARGS(state->rs_begin_lsn),
10021001
xid, GetCurrentTransactionId());
10031002

10041003
dlist_init(&src->mappings);
@@ -1120,8 +1119,7 @@ heap_xlog_logical_rewrite(XLogReaderState *r)
11201119
snprintf(path, MAXPGPATH,
11211120
"pg_logical/mappings/" LOGICAL_REWRITE_FORMAT,
11221121
xlrec->mapped_db, xlrec->mapped_rel,
1123-
(uint32) (xlrec->start_lsn >> 32),
1124-
(uint32) xlrec->start_lsn,
1122+
LSN_FORMAT_ARGS(xlrec->start_lsn),
11251123
xlrec->mapped_xid, XLogRecGetXid(r));
11261124

11271125
fd = OpenTransientFile(path,

0 commit comments

Comments
 (0)