Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
434b605
Add check for large files in meson.build
michaelpq Nov 12, 2025
84e8265
Report better object limits in error messages for injection points
michaelpq Nov 12, 2025
6acb670
doc: Fix incorrect synopsis for ALTER PUBLICATION ... DROP ...
MasaoFujii Nov 12, 2025
8747b96
Fix pg_upgrade around multixid and mxoff wraparound
hlinnaka Nov 12, 2025
3a438e4
Change coding pattern for CURL_IGNORE_DEPRECATION()
alvherre Nov 12, 2025
6ae5228
Fix range for commit_siblings in sample conf
danielgustafsson Nov 12, 2025
f024dee
doc: Document effects of ownership change on privileges
danielgustafsson Nov 12, 2025
aab4a84
Escalate ERRORs during async notify processing to FATAL
hlinnaka Nov 12, 2025
321ec54
Fix bug where we truncated CLOG that was still needed by LISTEN/NOTIFY
hlinnaka Nov 12, 2025
7b069a1
Fix remaining race condition with CLOG truncation and LISTEN/NOTIFY
hlinnaka Nov 12, 2025
82fa6b7
Clear 'xid' in dummy async notify entries written to fill up pages
hlinnaka Nov 12, 2025
b26d76f
Teach DSM registry to ERROR if attaching to an uninitialized entry.
nathan-bossart Nov 12, 2025
749f4ce
doc: Improve description of RLS policies applied by command type.
deanrasheed Nov 13, 2025
00e64e3
pgbench: Fix assertion failure with multiple \syncpipeline in pipelin…
MasaoFujii Nov 14, 2025
29cf93b
Add note about CreateStatistics()'s selective use of check_rights.
nathan-bossart Nov 14, 2025
c732139
Comment out autovacuum_worker_slots in postgresql.conf.sample.
nathan-bossart Nov 14, 2025
2ed2e71
Doc: include MERGE in variable substitution command list
david-rowley Nov 16, 2025
5749d95
Fix Assert failure in EXPLAIN ANALYZE MERGE with a concurrent update.
deanrasheed Nov 16, 2025
bcfca33
Define PS_USE_CLOBBER_ARGV on GNU/Hurd.
macdice Nov 16, 2025
74561f8
Mention md5 deprecation in postgresql.conf.sample
danielgustafsson Nov 17, 2025
bf5b13a
Clean up match_orclause_to_indexcol().
tglsfdc Nov 17, 2025
3e85af1
Update .abi-compliance-history for change to CreateStatistics().
nathan-bossart Nov 17, 2025
db4eba1
Fix pg_crc32c_armv8_choose.c to build with ancient glibc releases.
tglsfdc Nov 17, 2025
b56c26c
doc: clarify that pg_upgrade preserves "optimizer" stats.
bmomjian Nov 17, 2025
12bc329
Don't allow CTEs to determine semantic levels of aggregates.
tglsfdc Nov 18, 2025
b1fbc64
Fix typo
alvherre Nov 18, 2025
6a51707
Fix pg_popcount_aarch64.c to build with ancient glibc releases.
tglsfdc Nov 18, 2025
db0d2d7
Fix typo in nodeHash.c
Nov 19, 2025
c99436f
doc: Update formula for vacuum insert threshold.
nathan-bossart Nov 19, 2025
1959427
Print new OldestXID value in pg_resetwal when it's being changed
hlinnaka Nov 19, 2025
d984cef
doc: Update pg_upgrade documentation to match recent description chan…
MasaoFujii Nov 20, 2025
482e98a
Handle EPERM in pg_numa_init
tvondra Nov 20, 2025
912cfa3
jit: Adjust AArch64-only code for LLVM 21.
macdice Nov 22, 2025
f4e68a3
Fix incorrect IndexOptInfo header comment
david-rowley Nov 24, 2025
8082b75
lwlock: Fix, currently harmless, bug in LWLockWakeup()
anarazel Nov 24, 2025
0e4b1af
pg_dump tests: don't put dumps in stdout
alvherre Nov 25, 2025
3d8183e
oauth_validator: Shorten JSON responses in test logs
jchampio Nov 26, 2025
2f9ec45
doc: Clarify passphrase command reloading on Windows
danielgustafsson Nov 26, 2025
8551a28
Revert "Teach DSM registry to ERROR if attaching to an uninitialized …
nathan-bossart Nov 26, 2025
b83bcc0
Teach DSM registry to retry entry initialization if needed.
nathan-bossart Nov 26, 2025
15ba070
Fix error reporting for SQL/JSON path type mismatches
amitlan Nov 27, 2025
9ad15f4
doc: Fix misleading synopsis for CREATE/ALTER PUBLICATION.
MasaoFujii Nov 27, 2025
a212877
Allow indexscans on partial hash indexes with implied quals.
tglsfdc Nov 27, 2025
b880d9a
Avoid rewriting data-modifying CTEs more than once.
deanrasheed Nov 29, 2025
4061992
Update obsolete row compare preprocessing comments.
petergeoghegan Nov 29, 2025
50c63eb
Fix amcheck's handling of incomplete root splits in B-tree
hlinnaka Dec 2, 2025
19e7867
Fix amcheck's handling of half-dead B-tree pages
hlinnaka Dec 2, 2025
e46041f
Set next multixid's offset when creating a new multixid
hlinnaka Dec 3, 2025
df93f94
amcheck: Fix snapshot usage in bt_index_parent_check
alvherre Dec 4, 2025
28c5be4
Show version of nodes in output of TAP tests
michaelpq Dec 5, 2025
02ba5e3
Fix setting next multixid's offset at offset wraparound
hlinnaka Dec 5, 2025
18b3493
Fix text substring search for non-deterministic collations.
tglsfdc Dec 6, 2025
d3ceb20
Prevent invalidation of newly created replication slots.
Dec 8, 2025
5278222
Unify error messages
alvherre Dec 8, 2025
a59b039
Doc: fix typo in hash index documentation
david-rowley Dec 9, 2025
6c61c69
Fix LOCK_TIMEOUT handling in slotsync worker.
Dec 9, 2025
ae627d8
doc: Fix statement about ON CONFLICT and deferrable constraints.
deanrasheed Dec 9, 2025
1412c8e
doc: Fix titles of some pg_buffercache functions.
nathan-bossart Dec 9, 2025
bebb281
Fix O_CLOEXEC flag handling in Windows port.
macdice Dec 9, 2025
1756b9f
Fix failures with cross-version pg_upgrade tests
michaelpq Dec 10, 2025
e8dc581
Fix some near-bugs related to ResourceOwner function arguments
hlinnaka Dec 10, 2025
e08f338
Fix bogus extra arguments to query_safe in test
hlinnaka Dec 10, 2025
5b7bbf1
Fix allocation formula in llvmjit_expr.c
michaelpq Dec 11, 2025
580b5c2
pg_buffercache: Fix memory allocation formula
michaelpq Dec 11, 2025
3fbad03
Clarify comment on multixid offset wraparound check
hlinnaka Dec 15, 2025
bae8ca8
Revisit cosmetics of "For inplace update, send nontransactional inval…
nmisch Dec 15, 2025
169ff4c
libpq: Add missing OAuth translations
jchampio Dec 15, 2025
aac2556
libpq-oauth: Don't translate internal errors
jchampio Dec 15, 2025
7a15cff
libpq: Align oauth_json_set_error() with other NLS patterns
jchampio Dec 15, 2025
68ebdf2
Fail recovery when missing redo checkpoint record without backup_label
michaelpq Dec 16, 2025
b30089f
doc: Update header file mention for CompareType
danielgustafsson Dec 16, 2025
57df5ab
Switch memory contexts in ReinitializeParallelDSM.
robertmhaas Dec 16, 2025
06b030e
Update .abi-compliance-history for CacheInvalidateHeapTupleInplace().
nmisch Dec 16, 2025
f79e239
Fix multibyte issue in ltree_strncasecmp().
jeff-davis Dec 16, 2025
806555e
ltree: fix case-insensitive matching.
jeff-davis Dec 16, 2025
c8098aa
Make postmaster 003_start_stop.pl test less flaky
hlinnaka Dec 17, 2025
cc82448
libpq-fe.h: Don't claim SOCKTYPE in the global namespace
jchampio Dec 17, 2025
023a3c7
libpq-oauth: use correct c_args in meson.build
jchampio Dec 17, 2025
c3df857
oauth_validator: Avoid races in log_check()
jchampio Dec 17, 2025
d77a5f9
Do not emit WAL for unlogged BRIN indexes
hlinnaka Dec 18, 2025
573e679
Sort DO_SUBSCRIPTION_REL dump objects independent of OIDs.
nmisch Dec 18, 2025
b863d8d
Add guard to prevent recursive memory context logging.
MasaoFujii Dec 19, 2025
cf8c8ad
Update pg_hba.conf example to reflect MD5 deprecation
j-naylor Dec 19, 2025
a7d06e7
Clean up test_cloexec.c and Makefile.
macdice Dec 21, 2025
283e25a
doc: Fix incorrect reference in pg_overexplain documentation.
MasaoFujii Dec 22, 2025
b07c326
Fix orphaned origin in shared memory after DROP SUBSCRIPTION
michaelpq Dec 23, 2025
00a851f
Add missing .gitignore for src/test/modules/test_cloexec.
tglsfdc Dec 22, 2025
3e3a80f
Fix bug in following update chain when locking a heap tuple
hlinnaka Dec 23, 2025
2f7ffe1
Don't advance origin during apply failure.
Dec 24, 2025
214c17b
Update comments to reflect changes in 8e0d32a4a1.
Dec 24, 2025
02a0f38
doc: Use proper tags in pg_overexplain documentation.
MasaoFujii Dec 24, 2025
4e13769
psql: Fix tab completion for VACUUM option values.
MasahikoSawada Dec 24, 2025
382ce9c
Fix planner error with SRFs and grouping sets
Dec 25, 2025
2359c59
doc: Remove duplicate word in ECPG description
michaelpq Dec 26, 2025
c6d2cd0
doc: warn about the use of "ctid" queries beyond the examples
bmomjian Dec 26, 2025
06907e8
Fix pg_stat_get_backend_activity() to use multi-byte truncated result
michaelpq Dec 27, 2025
61c78e1
Add oauth_validator_libraries to variable_is_guc_list_quote
danielgustafsson Dec 27, 2025
b4cf744
Strip PlaceHolderVars from index operands
Dec 29, 2025
7e9f852
Ignore PlaceHolderVars when looking up statistics
Dec 29, 2025
4da5c33
Fix Mkvcbuild.pm builds of test_cloexec.c.
macdice Dec 29, 2025
c5e1281
jit: Remove -Wno-deprecated-declarations in 18+.
macdice Dec 30, 2025
fd7c86c
Fix a race condition in updating procArray->replication_slot_xmin.
MasahikoSawada Dec 30, 2025
6377b17
jit: Fix jit_profiling_support when unavailable.
macdice Dec 31, 2025
640772c
Fix macro name for io_uring_queue_init_mem check.
MasahikoSawada Dec 31, 2025
aa4b5eb
Update copyright for 2026
bmomjian Jan 1, 2026
07c1c6e
Fix selectivity estimation integer overflow in contrib/intarray
david-rowley Jan 4, 2026
789016b
Doc: add missing punctuation
david-rowley Jan 4, 2026
b63302d
Tighten up assertion on a local variable
hlinnaka Jan 5, 2026
eda0e93
ci: Remove ulimit -p for netbsd/openbsd
anarazel Jan 5, 2026
b86c2b7
doc: Fix outdated doc in pg_rewind.
MasaoFujii Jan 6, 2026
9ba5d40
Fix misleading comment for GetOperatorFromCompareType
david-rowley Jan 6, 2026
797fc5d
Honor GUC settings specified in CREATE SUBSCRIPTION CONNECTION.
MasaoFujii Jan 6, 2026
6ec5968
Add TAP test for GUC settings passed via CONNECTION in logical replic…
MasaoFujii Jan 6, 2026
bea57a6
Fix issue with EVENT TRIGGERS and ALTER PUBLICATION
david-rowley Jan 6, 2026
aa40615
Update comments atop ReplicationSlotCreate.
Jan 6, 2026
bdc5ded
Fix buggy interaction between array subscripts and subplan params
anarazel Jan 7, 2026
cdcab17
Further doc updates to reflect MD5 deprecation
j-naylor Jan 7, 2026
77ade60
createuser: Update docs to reflect defaults
j-naylor Jan 7, 2026
f9125ca
Fix typo
petere Jan 7, 2026
6c99c71
Fix nbtree skip array transformation comments.
petergeoghegan Jan 7, 2026
c35e5dd
Fix possible incorrect column reference in ERROR message
david-rowley Jan 8, 2026
39d5555
pg_dump: Fix gathering of sequence information.
nathan-bossart Jan 9, 2026
d2c6ff7
doc: Improve description of publish_via_partition_root
jchampio Jan 9, 2026
56e1f50
pg_dump: Fix memory leak in dumpSequenceData().
nathan-bossart Jan 11, 2026
6920fc3
doc: Document DEFAULT option in file_fdw.
MasaoFujii Jan 13, 2026
9c3caad
Fix query jumbling with GROUP BY clauses
michaelpq Jan 13, 2026
6489332
pg_waldump: Relax LSN comparison check in TAP test
michaelpq Jan 14, 2026
09532a7
Add check for invalid offset at multixid truncation
hlinnaka Jan 15, 2026
7f1b3a4
aio: io_uring: Fix danger of completion getting reused before being read
anarazel Jan 15, 2026
9ed411e
Fix 'unexpected data beyond EOF' on replica restart
hlinnaka Jan 15, 2026
a80811e
pgindent fix for 8077649907d
anarazel Jan 15, 2026
1943ceb
Fix segfault from releasing locks in detached DSM segments
amitlan Jan 16, 2026
f335457
Fix rowmark handling for non-relation RTEs during executor init
amitlan Jan 16, 2026
9b6714e
Fix crash in test function on removable_cutoff(NULL)
hlinnaka Jan 16, 2026
69ee819
Fix error message related to end TLI in backup manifest
michaelpq Jan 18, 2026
6574bee
Update time zone data files to tzdata release 2025c.
tglsfdc Jan 18, 2026
7650eab
Fix unsafe pushdown of quals referencing grouping Vars
Jan 19, 2026
c80b0c9
Don't set the truncation block length greater than RELSEG_SIZE.
robertmhaas Jan 19, 2026
3304e97
pg_stat_statements: Fix crash in list squashing with Vars
michaelpq Jan 19, 2026
85aedc6
doc: revert "xreflabel" used for PL/Python & libpq chapters
bmomjian Jan 20, 2026
3c83a2a
amcheck: Fix snapshot usage in bt_index_parent_check
alvherre Jan 21, 2026
f1c6b15
jit: Add missing inline pass for LLVM >= 17.
macdice Jan 22, 2026
a3bbd60
doc: Mention pg_get_partition_constraintdef()
michaelpq Jan 22, 2026
9f7c803
Remove faulty Assert in partitioned INSERT...ON CONFLICT DO UPDATE.
tglsfdc Jan 22, 2026
9f4b7bf
Fix bogus ctid requirement for dummy-root partitioned targets
amitlan Jan 23, 2026
c6ce4dc
Fix trigger transition table capture for MERGE in CTE queries.
deanrasheed Jan 24, 2026
ccde5be
Fix possible issue of a WindowFunc being in the wrong WindowClause
david-rowley Jan 26, 2026
7903377
Reduce length of TAP test file name.
robertmhaas Jan 26, 2026
eee71a6
Lookup the correct ordering for parallel GIN builds
tvondra Jan 26, 2026
3259339
Exercise parallel GIN builds in regression tests
tvondra Jan 26, 2026
9796c4f
Handle ENOENT status when querying NUMA node
tvondra Jan 26, 2026
3a8b6e5
pgindent fix for 3fccbd94cba
tvondra Jan 26, 2026
919c9fa
Prevent invalidation of newly synced replication slots.
Jan 27, 2026
8993bf0
Fix crash introduced by incorrect backport 806555e300.
jeff-davis Jan 27, 2026
444826b
oauth: Correct test dependency on oauth_hook_client
jchampio Jan 27, 2026
1c60f72
Fix CI failure introduced in commit 851f6649cc.
Jan 29, 2026
d42735b
psql: Disable %P (pipeline status) for non-active connection
michaelpq Jan 29, 2026
09d8c35
Fix theoretical memory leaks in pg_locale_libc.c.
jeff-davis Jan 29, 2026
fff87cb
Update .abi-compliance-history for change to TransitionCaptureState.
deanrasheed Jan 30, 2026
92b3cc5
Improve guards against false regex matches in BackgroundPsql.pm.
tglsfdc Jan 30, 2026
d5a4856
Fix build inconsistency due to the generation of wait-event code
michaelpq Feb 1, 2026
ab61f00
Fix error message in RemoveWalSummaryIfOlderThan()
michaelpq Feb 2, 2026
719aa13
Fix incorrect errno in OpenWalSummaryFile()
michaelpq Feb 3, 2026
492a69e
Reject ADD CONSTRAINT NOT NULL if name mismatches existing constraint
alvherre Feb 3, 2026
a0f98b2
Update .abi-compliance-history for AdjustNotNullInheritance().
alvherre Feb 3, 2026
2ca4464
pg_resetwal: Fix incorrect error message related to pg_wal/summaries/
michaelpq Feb 4, 2026
b5e1cd2
Fix various instances of undefined behavior
j-naylor Feb 4, 2026
8eb17e8
Fix logical replication TAP test to read publisher log correctly.
MasaoFujii Feb 4, 2026
441de63
doc: Move synchronized_standby_slots to "Primary Server" section.
MasaoFujii Feb 6, 2026
33e3de6
Add file_extend_method=posix_fallocate,write_zeros.
macdice May 31, 2025
acfa422
Fix some error message inconsistencies
michaelpq Feb 6, 2026
e679d0f
Fix use of proc number in pgstat_create_backend()
michaelpq Feb 6, 2026
c6881f7
First-draft release notes for 18.2.
tglsfdc Feb 6, 2026
3c3b34b
Placate ABI checker.
macdice Feb 6, 2026
cff2ef9
Further error message fix
petere Feb 7, 2026
5eac1d6
meson: host_system value for Solaris is 'sunos' not 'solaris'.
tglsfdc Feb 8, 2026
731e032
Translation updates
petere Feb 8, 2026
5944beb
Release notes for 18.2, 17.8, 16.12, 15.16, 14.21.
tglsfdc Feb 8, 2026
209f387
pgcrypto: Fix buffer overflow in pgp_pub_decrypt_bytea()
michaelpq Feb 8, 2026
1854868
Remove 'charlen' argument from make_trigrams()
hlinnaka Jan 20, 2026
e0965fb
Fix buffer overflows in pg_trgm due to lower-casing
hlinnaka Jan 20, 2026
df0852f
Fix encoding length for EUC_CN.
macdice Feb 4, 2026
efef05b
Fix mb2wchar functions on short input.
macdice Jan 25, 2026
7b5fc85
Replace pg_mblen() with bounds-checked versions.
macdice Jan 7, 2026
b0f5d25
Code coverage for most pg_mblen* calls.
macdice Jan 11, 2026
b427091
Require PGP-decrypted text to pass encoding validation.
nmisch Feb 9, 2026
3b6588c
Guard against unexpected dimensions of oidvector/int2vector.
tglsfdc Feb 9, 2026
66ddac6
Require superuser to install a non-built-in selectivity estimator.
tglsfdc Feb 9, 2026
b69af3d
Harden _int_matchsel() against being attached to the wrong operator.
tglsfdc Feb 9, 2026
4543b02
Fix test "NUL byte in text decrypt" for --without-zlib builds.
nmisch Feb 9, 2026
30d2603
Last-minute updates for release notes.
tglsfdc Feb 9, 2026
5a461dc
Stamp 18.2.
tglsfdc Feb 9, 2026
35466b9
Update Postgres 18 to 18.2
thesuhas Feb 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 46 additions & 0 deletions .abi-compliance-history
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,52 @@
# Be sure to replace "<ADD JUSTIFICATION HERE>" with details of your change and
# why it is deemed acceptable.

33e3de6d77e87d6c3c6f8f878dd8de42d37c3b8f
#
# Add file_extend_method=posix_fallocate,write_zeros.
# 2026-02-06 17:38:39 +1300
#
# Modifying GUC tables isn't really an ABI break: the relevant object has
# incomplete type so its layout is unknown to other C translation units.
#
# Discussion: https://www.postgresql.org/message-id/flat/e1f0cd3b-0164-45f5-9705-e922e59df90f%40dunslane.net#8a350b54012c0042f9869d288e978cfe

492a69e1407029f8c673484f44aa719a63323d77
#
# Reject ADD CONSTRAINT NOT NULL if name mismatches existing constraint
# 2026-02-03 12:33:29 +0100
#
# This commit added the constraint name as a parameter to
# AdjustNotNullInheritance(), which it needed to verify that the new name
# matches the existing one. PGXN contained no calls to that function.

c6ce4dcf9d3b7a8a89aca386124c473f98fc329e
#
# Fix trigger transition table capture for MERGE in CTE queries.
# 2026-01-24 11:30:48 +0000
#
# This commit changed the TransitionCaptureState structure, replacing
# the "tcs_private" field with 3 separate fields. This structure can
# only be built using MakeTransitionCaptureState(), and PGXN contained
# no calls to MakeTransitionCaptureState() or uses of the
# TransitionCaptureState structure.

bae8ca82fd00603ebafa0658640d6e4dfe20af92
#
# Revisit cosmetics of "For inplace update, send nontransactional invalidations."
# 2025-12-15 12:19:53 -0800
#
# This removed a CacheInvalidateHeapTupleInplace() parameter. PGXN contained
# no calls to that function.

00eb646ea43410e5df77fed96f4a981e66811796
#
# Check for CREATE privilege on the schema in CREATE STATISTICS.
# 2025-11-10 09:00:00 -0600
#
# This commit added a parameter to CreateStatistics(). We are unaware of any
# impacted third-party code.

c8af5019bee5c57502db830f8005a01cba60fee0
#
# Fix lookups in pg_{clear,restore}_{attribute,relation}_stats().
Expand Down
5 changes: 1 addition & 4 deletions .cirrus.tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ task:
su postgres <<-EOF
set -e
ulimit -c unlimited
# Otherwise tests will fail on OpenBSD, due to inability to start enough
# processes.
ulimit -p 256
meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
EOF

Expand Down Expand Up @@ -596,7 +593,7 @@ task:
env:
CPUS: 4 # always get that much for cirrusci macOS instances
BUILD_JOBS: $CPUS
# Test performance regresses noticably when using all cores. 8 seems to
# Test performance regresses noticeably when using all cores. 8 seems to
# work OK. See
# https://postgr.es/m/20220927040208.l3shfcidovpzqxfh%40awork3.anarazel.de
TEST_JOBS: 8
Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PostgreSQL Database Management System
(also known as Postgres, formerly known as Postgres95)

Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group

Portions Copyright (c) 1994, The Regents of the University of California

Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for PostgreSQL 18.1.
# Generated by GNU Autoconf 2.69 for PostgreSQL 18.2.
#
# Report bugs to <pgsql-bugs@lists.postgresql.org>.
#
Expand Down Expand Up @@ -582,8 +582,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='PostgreSQL'
PACKAGE_TARNAME='postgresql'
PACKAGE_VERSION='18.1'
PACKAGE_STRING='PostgreSQL 18.1'
PACKAGE_VERSION='18.2'
PACKAGE_STRING='PostgreSQL 18.2'
PACKAGE_BUGREPORT='pgsql-bugs@lists.postgresql.org'
PACKAGE_URL='https://www.postgresql.org/'

Expand Down Expand Up @@ -1470,7 +1470,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures PostgreSQL 18.1 to adapt to many kinds of systems.
\`configure' configures PostgreSQL 18.2 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1535,7 +1535,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of PostgreSQL 18.1:";;
short | recursive ) echo "Configuration of PostgreSQL 18.2:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1727,7 +1727,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
PostgreSQL configure 18.1
PostgreSQL configure 18.2
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2480,7 +2480,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by PostgreSQL $as_me 18.1, which was
It was created by PostgreSQL $as_me 18.2, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -20176,7 +20176,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by PostgreSQL $as_me 18.1, which was
This file was extended by PostgreSQL $as_me 18.2, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -20247,7 +20247,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
PostgreSQL config.status 18.1
PostgreSQL config.status 18.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
dnl
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros

AC_INIT([PostgreSQL], [18.1], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
AC_INIT([PostgreSQL], [18.2], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])

m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
Untested combinations of 'autoconf' and PostgreSQL versions are not
Expand Down
24 changes: 24 additions & 0 deletions contrib/amcheck/t/002_cic.pl
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,29 @@
)
});

# Test bt_index_parent_check() with indexes created with
# CREATE INDEX CONCURRENTLY.
$node->safe_psql('postgres', q(CREATE TABLE quebec(i int primary key)));
# Insert two rows into index
$node->safe_psql('postgres',
q(INSERT INTO quebec SELECT i FROM generate_series(1, 2) s(i);));

# start background transaction
my $in_progress_h = $node->background_psql('postgres');
$in_progress_h->query_safe(q(BEGIN; SELECT pg_current_xact_id();));

# delete one row from table, while background transaction is in progress
$node->safe_psql('postgres', q(DELETE FROM quebec WHERE i = 1;));
# create index concurrently, which will skip the deleted row
$node->safe_psql('postgres',
q(CREATE INDEX CONCURRENTLY oscar ON quebec(i);));

# check index using bt_index_parent_check
my $result = $node->psql('postgres',
q(SELECT bt_index_parent_check('oscar', heapallindexed => true)));
is($result, '0', 'bt_index_parent_check for CIC after removed row');

$in_progress_h->quit;

$node->stop;
done_testing();
90 changes: 39 additions & 51 deletions contrib/amcheck/verify_nbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ typedef struct BtreeCheckState
BufferAccessStrategy checkstrategy;

/*
* Info for uniqueness checking. Fill these fields once per index check.
* Info for uniqueness checking. Fill this field and the one below once
* per index check.
*/
IndexInfo *indexinfo;
/* Table scan snapshot for heapallindexed and checkunique */
Snapshot snapshot;

/*
Expand Down Expand Up @@ -382,7 +384,6 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
BTMetaPageData *metad;
uint32 previouslevel;
BtreeLevel current;
Snapshot snapshot = SnapshotAny;

if (!readonly)
elog(DEBUG1, "verifying consistency of tree structure for index \"%s\"",
Expand Down Expand Up @@ -433,54 +434,46 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
state->heaptuplespresent = 0;

/*
* Register our own snapshot in !readonly case, rather than asking
* Register our own snapshot for heapallindexed, rather than asking
* table_index_build_scan() to do this for us later. This needs to
* happen before index fingerprinting begins, so we can later be
* certain that index fingerprinting should have reached all tuples
* returned by table_index_build_scan().
*/
if (!state->readonly)
{
snapshot = RegisterSnapshot(GetTransactionSnapshot());
state->snapshot = RegisterSnapshot(GetTransactionSnapshot());

/*
* GetTransactionSnapshot() always acquires a new MVCC snapshot in
* READ COMMITTED mode. A new snapshot is guaranteed to have all
* the entries it requires in the index.
*
* We must defend against the possibility that an old xact
* snapshot was returned at higher isolation levels when that
* snapshot is not safe for index scans of the target index. This
* is possible when the snapshot sees tuples that are before the
* index's indcheckxmin horizon. Throwing an error here should be
* very rare. It doesn't seem worth using a secondary snapshot to
* avoid this.
*/
if (IsolationUsesXactSnapshot() && rel->rd_index->indcheckxmin &&
!TransactionIdPrecedes(HeapTupleHeaderGetXmin(rel->rd_indextuple->t_data),
snapshot->xmin))
ereport(ERROR,
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
errmsg("index \"%s\" cannot be verified using transaction snapshot",
RelationGetRelationName(rel))));
}
/*
* GetTransactionSnapshot() always acquires a new MVCC snapshot in
* READ COMMITTED mode. A new snapshot is guaranteed to have all the
* entries it requires in the index.
*
* We must defend against the possibility that an old xact snapshot
* was returned at higher isolation levels when that snapshot is not
* safe for index scans of the target index. This is possible when
* the snapshot sees tuples that are before the index's indcheckxmin
* horizon. Throwing an error here should be very rare. It doesn't
* seem worth using a secondary snapshot to avoid this.
*/
if (IsolationUsesXactSnapshot() && rel->rd_index->indcheckxmin &&
!TransactionIdPrecedes(HeapTupleHeaderGetXmin(rel->rd_indextuple->t_data),
state->snapshot->xmin))
ereport(ERROR,
errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
errmsg("index \"%s\" cannot be verified using transaction snapshot",
RelationGetRelationName(rel)));
}

/*
* We need a snapshot to check the uniqueness of the index. For better
* performance take it once per index check. If snapshot already taken
* reuse it.
* We need a snapshot to check the uniqueness of the index. For better
* performance, take it once per index check. If one was already taken
* above, use that.
*/
if (state->checkunique)
{
state->indexinfo = BuildIndexInfo(state->rel);
if (state->indexinfo->ii_Unique)
{
if (snapshot != SnapshotAny)
state->snapshot = snapshot;
else
state->snapshot = RegisterSnapshot(GetTransactionSnapshot());
}

if (state->indexinfo->ii_Unique && state->snapshot == InvalidSnapshot)
state->snapshot = RegisterSnapshot(GetTransactionSnapshot());
}

Assert(!state->rootdescend || state->readonly);
Expand Down Expand Up @@ -555,30 +548,28 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
/*
* Create our own scan for table_index_build_scan(), rather than
* getting it to do so for us. This is required so that we can
* actually use the MVCC snapshot registered earlier in !readonly
* case.
* actually use the MVCC snapshot registered earlier.
*
* Note that table_index_build_scan() calls heap_endscan() for us.
*/
scan = table_beginscan_strat(state->heaprel, /* relation */
snapshot, /* snapshot */
state->snapshot, /* snapshot */
0, /* number of keys */
NULL, /* scan key */
true, /* buffer access strategy OK */
true); /* syncscan OK? */

/*
* Scan will behave as the first scan of a CREATE INDEX CONCURRENTLY
* behaves in !readonly case.
* behaves.
*
* It's okay that we don't actually use the same lock strength for the
* heap relation as any other ii_Concurrent caller would in !readonly
* case. We have no reason to care about a concurrent VACUUM
* operation, since there isn't going to be a second scan of the heap
* that needs to be sure that there was no concurrent recycling of
* TIDs.
* heap relation as any other ii_Concurrent caller would. We have no
* reason to care about a concurrent VACUUM operation, since there
* isn't going to be a second scan of the heap that needs to be sure
* that there was no concurrent recycling of TIDs.
*/
indexinfo->ii_Concurrent = !state->readonly;
indexinfo->ii_Concurrent = true;

/*
* Don't wait for uncommitted tuple xact commit/abort when index is a
Expand All @@ -602,14 +593,11 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
state->heaptuplespresent, RelationGetRelationName(heaprel),
100.0 * bloom_prop_bits_set(state->filter))));

if (snapshot != SnapshotAny)
UnregisterSnapshot(snapshot);

bloom_free(state->filter);
}

/* Be tidy: */
if (snapshot == SnapshotAny && state->snapshot != InvalidSnapshot)
if (state->snapshot != InvalidSnapshot)
UnregisterSnapshot(state->snapshot);
MemoryContextDelete(state->targetcontext);
}
Expand Down
Loading