Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aio prefetch #533

Open
wants to merge 292 commits into
base: anastasia/REL_17_STABLE_neon
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
292 commits
Select commit Hold shift + click to select a range
667401d
Document limit on the number of out-of-line values per table
j-naylor Aug 20, 2024
effc4c9
Fix a couple of wait event descriptions.
nathan-bossart Aug 20, 2024
5effd59
Minor wording change in table "JSON Creation Functions"
alvherre Aug 20, 2024
915aafe
Don't advance origin during apply failure.
Aug 21, 2024
0c7ec3b
doc: remove llvm-config search from configure documentation
petere Aug 21, 2024
2366ab2
Disallow creating binary-coercible casts involving range types.
tglsfdc Aug 21, 2024
f636ab4
Avoid repeated table name lookups in createPartitionTable()
akorotkov Aug 22, 2024
6b1f78d
Fix attach of a previously-detached injection point.
nmisch Aug 22, 2024
79c3012
Provide feature-test macros for libpq features added in v17.
tglsfdc Aug 23, 2024
bf886df
pg_createsubscriber: Message style improvements
petere Aug 24, 2024
29e1253
Add list of acknowledgments to release notes
petere Aug 24, 2024
84f594d
Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands
akorotkov Aug 24, 2024
74e3db0
doc PG 17 relnotes: remove ALTER TABLE SPLIT/MERGE PARTITION
bmomjian Aug 26, 2024
5e58107
pg_upgrade: Message style improvements
petere Aug 26, 2024
6749d4a
Fix nbtree lookahead overflow bug.
petergeoghegan Aug 26, 2024
dbed2e3
Fix memory counter update in ReorderBuffer.
MasahikoSawada Aug 26, 2024
c739ae9
Fix identation.
MasahikoSawada Aug 26, 2024
203b5ce
Fix misplaced translator comments
petere Aug 27, 2024
0be079e
Message style improvements
petere Aug 27, 2024
135007a
Doc: Fix the ambiguity in the description of failover slots.
Aug 29, 2024
fdbf7e4
Disallow USING clause when altering type of generated column
petere Aug 29, 2024
f2353dd
Message style improvements
petere Aug 29, 2024
a7eb633
Fix mis-deparsing of ORDER BY lists when there is a name conflict.
tglsfdc Aug 29, 2024
47b92f8
Correct name in list of acknowledgments
petere Aug 30, 2024
df80b1d
Remove duplicate name from list of acknowledgments
petere Aug 30, 2024
df51201
Update list of acknowledgments in release notes
petere Aug 30, 2024
b431108
Avoid inserting PlaceHolderVars in cases where pre-v16 PG did not.
tglsfdc Aug 30, 2024
8749d85
Make postgres_fdw's query_cancel test less flaky.
tglsfdc Aug 30, 2024
0776724
Clarify restrict_nonsystem_relation_kind description.
MasahikoSawada Aug 30, 2024
34226d4
Stabilize 039_end_of_wal test.
macdice Aug 31, 2024
3ed3683
Fix unfairness in all-cached parallel seq scan.
macdice Aug 31, 2024
986a3ac
Translation updates
petere Sep 2, 2024
e6ec1d6
Fix rarely-run test for message wording change
petere Sep 2, 2024
c96176c
Fix warnings from msgfmt
petere Sep 2, 2024
94f1474
Stamp 17rc1.
tglsfdc Sep 2, 2024
ff43b5e
Simplify makefiles exporting twice enable_injection_points
michaelpq Sep 3, 2024
bab1fd9
Avoid installcheck failure in TAP tests using injection_points
michaelpq Sep 3, 2024
07b828e
Fix inconsistent LWLock tranche name "CommitTsSLRU"
michaelpq Sep 4, 2024
7dcbf0a
Prevent mis-encoding of "trailing junk after numeric literal" errors.
tglsfdc Sep 5, 2024
35afec7
doc PG 17 relnotes: remove tab complete for MERGE/SPLIT partit.
bmomjian Sep 6, 2024
fe32343
Update comment about ExprState.escontext
amitlan Sep 6, 2024
c88ce38
SQL/JSON: Fix JSON_TABLE() column deparsing
amitlan Sep 6, 2024
5067c23
SQL/JSON: Fix default ON ERROR behavior for JSON_TABLE
amitlan Sep 6, 2024
e4e2797
SQL/JSON: Avoid initializing unnecessary ON ERROR / ON EMPTY steps
amitlan Sep 6, 2024
eef5195
Revert recent SQL/JSON related commits
amitlan Sep 6, 2024
cd680b3
SQL/JSON: Fix JSON_TABLE() column deparsing
amitlan Sep 6, 2024
446d5ad
SQL/JSON: Fix default ON ERROR behavior for JSON_TABLE
amitlan Sep 6, 2024
e69030c
Fix incorrect pg_stat_io output on 32-bit machines.
tglsfdc Sep 6, 2024
cd6b2ae
Fix waits of REINDEX CONCURRENTLY for indexes with predicates or expr…
michaelpq Sep 9, 2024
77aebe9
SQL/JSON: Avoid initializing unnecessary ON ERROR / ON EMPTY steps
amitlan Sep 9, 2024
946f150
Fix some whitespace issues in XMLSERIALIZE(... INDENT).
tglsfdc Sep 10, 2024
78bc5f7
Fix unique key checks in JSON object constructors
tvondra Sep 11, 2024
7748c84
pg_createsubscriber: minor documentation fixes
mhagander Sep 11, 2024
7f88e50
Remove incorrect Assert.
tglsfdc Sep 11, 2024
2c27346
SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER)
amitlan Sep 12, 2024
2645f6d
Doc: alphabetize aggregate function table
david-rowley Sep 12, 2024
cc4fdfa
Make jsonpath .string() be immutable for datetimes.
tglsfdc Sep 12, 2024
6ea7f04
Reintroduce support for sequences in pgstattuple and pageinspect.
nathan-bossart Sep 12, 2024
32ccfa0
SQL/JSON: Update example in JSON_QUERY() documentation
amitlan Sep 13, 2024
9f949c9
doc PG 17 relnotes: add links to commits
bmomjian Sep 13, 2024
9b3c3c0
Fix contrib/pageinspect's test for sequences.
nathan-bossart Sep 13, 2024
b9a65a6
doc PG 17 relnotes: replace commit hashes with section marks
bmomjian Sep 13, 2024
418c6a2
Allow _h_indexbuild() to be interrupted.
tglsfdc Sep 13, 2024
26cea9f
doc PG 17 relnotes: add dynamic shared memory registry item
bmomjian Sep 13, 2024
4e7b9a1
doc PG 17 relnotes: move partition access method item
bmomjian Sep 13, 2024
648397b
Only define NO_THREAD_SAFE_LOCALE for MSVC plperl when required
adunstan Sep 14, 2024
984702d
doc PG 17 relnotes: move EXPLAIN items to their own section
bmomjian Sep 14, 2024
dc2a660
Improve meson's detection of perl build flags
adunstan Sep 14, 2024
54497e0
doc PG 17 relnotes: update to current
bmomjian Sep 14, 2024
e3b2c65
Remove obsolete comment in pg_stat_statements.
tglsfdc Sep 14, 2024
4a89807
doc PG 17 relnotes: remove commit link whose comment was removed
bmomjian Sep 14, 2024
77120dd
doc PG 17 relnotes: adjust SGML format for commit add script
bmomjian Sep 14, 2024
fca91b5
Add commit 7229ebe011df to .git-blame-ignore-revs.
alvherre Sep 14, 2024
6283ff2
Run regression tests with timezone America/Los_Angeles.
tglsfdc Sep 14, 2024
b9645dc
Replace usages of xmlXPathCompile() with xmlXPathCtxtCompile().
tglsfdc Sep 15, 2024
054a23b
scripts: add Perl script to add links to release notes
bmomjian Sep 16, 2024
a24bffc
Avoid parallel nbtree index scan hangs with SAOPs.
petergeoghegan Sep 17, 2024
f7567f9
Repair pg_upgrade for identity sequences with non-default persistence.
tglsfdc Sep 17, 2024
ec1d545
Allow ReadStream to be consumed as raw block numbers.
macdice Sep 17, 2024
7db9bfc
Add missing query ID reporting in extended query protocol
michaelpq Sep 18, 2024
2370582
Don't enter parallel mode when holding interrupts.
nmisch Sep 18, 2024
633b609
Update list of acknowledgments in release notes
petere Sep 18, 2024
fa3a022
docs: Improve the description of num_timed column in pg_stat_checkpoi…
MasaoFujii Sep 18, 2024
120f883
doc PG relnotes: no relnote footnotes for commit links in PDF
bmomjian Sep 18, 2024
19b389c
doc PG relnotes: add paragraph explaining the section symbol
bmomjian Sep 18, 2024
b0ae6db
psql: Fix memory leak with repeated calls of \bind
michaelpq Sep 19, 2024
681bbd0
Improve Perl script which adds commit links to release notes
bmomjian Sep 19, 2024
95fba23
doc PG relnotes: rename commit link paragraph for clarity
bmomjian Sep 19, 2024
ff25193
doc PG relnotes: document "Unresolved ID reference found" cause
bmomjian Sep 19, 2024
a24cd4b
doc PG relnotes: remove warning about commit links in PDF build
bmomjian Sep 19, 2024
fb4f5e5
Fix nbtree pgstats accounting with parallel scans.
petergeoghegan Sep 20, 2024
a47ad3a
Doc: explain how to test ADMIN privilege with pg_has_role().
tglsfdc Sep 20, 2024
1d7cef2
doc PG 17 relnotes: add major features list
bmomjian Sep 20, 2024
64b61fa
Doc: update 17.0 release date.
tglsfdc Sep 20, 2024
29d483f
Translation updates
petere Sep 23, 2024
d7ec59a
Stamp 17.0.
tglsfdc Sep 23, 2024
866fd7c
Add prefetching to pg_prewarm's autoprewarm worker.
MMeent Jul 30, 2024
26650c4
Mark pg_prewarm as a trusted extension
MMeent Jul 30, 2024
abfd499
NEON: Fix BRIN redo in PS' WAL-redo process
MMeent Jul 30, 2024
bd09a75
NEON: Adapt SMGR for extensibility.
MMeent Jul 30, 2024
e1b32d7
NEON: Replace tuple INSERT/UPDATE/DELETE records with custom ones
MMeent Jul 30, 2024
8494635
NEON: Update Sequence logging to 0 (from 32)
MMeent Jul 30, 2024
700e77e
NEON: Dynamic loading of extension's libraries.
MMeent Jul 30, 2024
2ea6455
NEON: Unlogged build delineation
MMeent Jul 30, 2024
98745b7
NEON: Allow the user to specify a cluster ID in initdb
MMeent Jul 31, 2024
379ee5f
NEON: Add a LwLsnCache for keeping track of recent smgr-level changes
MMeent Jul 31, 2024
feb6c00
NEON: Expose lag tracker, CHECK_FOR_INTERRUPTS, add backpressure
MMeent Jul 31, 2024
a4e665a
NEON: WalRedo & startup process compatibility
MMeent Jul 31, 2024
19d879f
Add prefetching to various scan types
MMeent Jul 31, 2024
b4357e3
NEON: Various compatibility changes:
MMeent Jul 31, 2024
14d522d
NEON: Extend EXPLAIN with options for LFC and Prefetch IO metrics
MMeent Jul 31, 2024
5eb05c8
NEON: Various compatibility fixes:
MMeent Jul 31, 2024
be63d48
NEON: Log various stateful objects to pass messages around
MMeent Jul 31, 2024
965b6b3
Add missing import in access/transam/xlogprefetcher.c
MMeent Jul 31, 2024
62ee76b
Add vectorized versions of Get/SetLastWrittenLsnForBlock
MMeent Aug 21, 2024
0f8c52e
Make logical apply worker take into account syncrep flush position.
arssher Aug 21, 2024
83a679d
Add on-demand WAL download to slotfuncs
Aug 21, 2024
0e6c1d4
Preserve combocid v17
knizhnik Aug 21, 2024
9536f8e
Use smgrexists() to enforce uniqueness of generated relfilenumber
knizhnik Aug 21, 2024
4502a14
Remove assertion. TODO figure out why and add a comment
lubennikovaav Aug 8, 2024
66c8d0d
fix wal-redo buffer management
lubennikovaav Aug 9, 2024
dd3f30f
Fix: --sysid needs to be passed around carefully.
MMeent Aug 26, 2024
503bce0
Fix GetLwLsn for special keys
MMeent Aug 26, 2024
ddc2d9a
Cherry-pick from V16: Undo walloging replorgin file on checkpoint (#472)
knizhnik Aug 28, 2024
df7c784
ERROR out instead of segfaulting when walsender slots are full.
arssher Sep 5, 2024
619b54a
logical worker: respond to publisher even under dense stream.
arssher Sep 9, 2024
92918f0
Fix remote extension download v17 (#507)
lubennikovaav Sep 20, 2024
4d28d67
Fix init of WAL page header at startup
hlinnaka Sep 20, 2024
68b5038
Fix: Don't flush a buffer in am_wal_redo_postgres mode (#512)
MMeent Sep 23, 2024
923a715
Fix psql describe commands' handling of ACL columns for old servers.
tglsfdc Sep 24, 2024
f33bf1c
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.
nmisch Sep 24, 2024
fd27b87
Fix data loss at inplace update after heap_update().
nmisch Sep 24, 2024
3b7a689
For inplace update durability, make heap_update() callers wait.
nmisch Sep 24, 2024
85cb21d
vacuumdb: Skip temporary tables in query to build list of relations
michaelpq Sep 25, 2024
4e0864a
Remove extra whitespace in pg_upgrade status message.
nathan-bossart Sep 25, 2024
3e8c92c
Doc: InitPlans aren't parallel-restricted any more.
tglsfdc Sep 26, 2024
1532599
Fix incorrect memory access in VACUUM FULL with invalid toast indexes
michaelpq Sep 27, 2024
18cea25
doc: Note that CREATE MATERIALIZED VIEW restricts search_path.
nathan-bossart Sep 27, 2024
4aad471
Avoid 037_invalid_database.pl hang under debug_discard_caches.
nmisch Sep 27, 2024
da99df1
Remove NULL dereference from RenameRelationInternal().
nmisch Sep 29, 2024
77f1546
reindexdb: Skip reindexing temporary tables and indexes.
MasaoFujii Sep 30, 2024
6596a8c
Remove incorrect entries in pg_walsummary's getopt_long call.
tglsfdc Sep 30, 2024
f250cb2
Fix race condition in COMMIT PREPARED causing orphaned 2PC files
michaelpq Oct 1, 2024
a94d5b3
Doc: replace unnecessary non-breaking space with ordinal space.
tatsuo-ishii Oct 1, 2024
97dccef
doc: Clarify name of files generated by pg_waldump --save-fullpage
michaelpq Oct 2, 2024
c7a2010
Parse libpq's "keepalives" option more like other integer options.
tglsfdc Oct 2, 2024
d7d297f
Fix incorrect non-strict join recheck in MERGE WHEN NOT MATCHED BY SO…
deanrasheed Oct 3, 2024
34ae54a
Fix wrong varnullingrels error for MERGE WHEN NOT MATCHED BY SOURCE.
deanrasheed Oct 3, 2024
9c7acc3
Reject non-ASCII locale names.
macdice Oct 5, 2024
fee8cb9
Use generateClonedIndexStmt to propagate CREATE INDEX to partitions.
tglsfdc Oct 5, 2024
3daeb53
Ignore not-yet-defined Portals in pg_cursors view.
tglsfdc Oct 6, 2024
9181077
Fix fetching default toast value during decoding of in-progress trans…
Oct 7, 2024
a356d23
Fix Y2038 issues with MyStartTime.
nathan-bossart Oct 7, 2024
5bd26e6
vacuumdb: Schema-qualify operator in catalog query's WHERE clause.
nathan-bossart Oct 7, 2024
a8b2402
doc PG 17 relnotes: move adminpack item to incompatibilities
bmomjian Oct 8, 2024
2fe4167
Fix search_path cache initialization.
jeff-davis Oct 8, 2024
c4b8a91
Stabilize the test added by commit 022564f60c.
Oct 8, 2024
c5b9097
Remove incorrect function import from pgindent
danielgustafsson Oct 9, 2024
647e76c
doc: Fix mention of AT LOCAL in release notes
danielgustafsson Oct 9, 2024
a3c4a91
Avoid crash in estimate_array_length with null root pointer.
tglsfdc Oct 9, 2024
7e059fb
doc PG 17 relnotes: add missing commands for safe search path
bmomjian Oct 10, 2024
912d15c
doc PG 17 relnotes: clarify pg_upgrade and logical slot preserv.
bmomjian Oct 10, 2024
ff33df2
Fix missed case for builtin collation provider.
jeff-davis Oct 11, 2024
54889ea
Correctly identify which EC members are computable at a plan node.
tglsfdc Oct 12, 2024
8a61708
psql: Fix \watch when using interval values less than 1ms
michaelpq Oct 14, 2024
8aaca07
Add type cast to foreach_internal's loop variable.
nathan-bossart Oct 15, 2024
064e040
Fix typo in comment of transformJsonAggConstructor()
amitlan Oct 16, 2024
eef9cc4
Reduce memory block size for decoded tuple storage to 8kB.
MasahikoSawada Oct 16, 2024
b5eef75
Further refine _SPI_execute_plan's rule for atomic execution.
tglsfdc Oct 16, 2024
a30c1ca
Rewrite some regression queries for option checks with COPY
michaelpq Oct 16, 2024
c06a474
Fix validation of COPY FORCE_NOT_NULL/FORCE_NULL for the all-column c…
michaelpq Oct 16, 2024
e90d108
Fix whitespace
petere Oct 17, 2024
4ac5d33
Fix extreme skew detection in Parallel Hash Join.
macdice Oct 17, 2024
b8d08aa
Fix description of PostgreSQL::Test::Cluster::wait_for_event()
michaelpq Oct 18, 2024
053b6da
Adjust documentation for configuring Linux huge pages.
nathan-bossart Oct 18, 2024
7148cb3
SQL/JSON: Fix some oversights in commit b6e1157e7
amitlan Oct 20, 2024
e9959ff
Note that index_name in ALTER INDEX ATTACH PARTITION can be schema-qu…
alvherre Oct 20, 2024
234f6d0
Fix race condition in committing a serializable transaction
hlinnaka Oct 21, 2024
3685ad6
Fix wrong assertion and poor error messages in "COPY (query) TO".
tglsfdc Oct 21, 2024
5914a22
Restructure foreign key handling code for ATTACH/DETACH
alvherre Oct 22, 2024
2c37cb2
ecpg: Fix out-of-bound read in DecodeDateTime()
michaelpq Oct 22, 2024
f92f6b3
Remove unnecessary word in a comment
amitlan Oct 23, 2024
0a05920
doc: Fix INSERT statement syntax for identity columns
danielgustafsson Oct 23, 2024
e119076
Stop reading uninitialized memory in heap_inplace_lock().
nmisch Oct 24, 2024
a4668c9
At end of recovery, reset all sinval-managed caches.
nmisch Oct 25, 2024
95c5acb
For inplace update, send nontransactional invalidations.
nmisch Oct 25, 2024
bfd5c6e
WAL-log inplace update before revealing it to other sessions.
nmisch Oct 25, 2024
22b9141
Fix overflow in bsearch_arg() with more than INT_MAX elements
hlinnaka Oct 28, 2024
e631ed8
Guard against enormously long input in pg_saslprep().
tglsfdc Oct 28, 2024
bb584e8
Fix dependency of partitioned table and table AM with CREATE TABLE ..…
michaelpq Oct 28, 2024
e5086b3
Doc: clarify enable_indexscan=off also disabled Index Only Scans
david-rowley Oct 29, 2024
709ce29
doc: Add better description for rewrite functions in event triggers
michaelpq Oct 29, 2024
cad6590
Update time zone data files to tzdata release 2024b.
tglsfdc Oct 29, 2024
9aef6f1
Unpin buffer before inplace update waits for an XID to end.
nmisch Oct 29, 2024
936ab6d
Fix some more bugs in foreign keys connecting partitioned tables
alvherre Oct 30, 2024
c177726
Fix bug in nbtree array primitive scan scheduling.
petergeoghegan Oct 30, 2024
a358019
Stabilize jsonb_path_query test case.
tglsfdc Oct 30, 2024
787bd3d
doc: remove mention of ActiveState for Perl and Tcl on Windows
bmomjian Nov 1, 2024
0a0a0f2
doc: fix ALTER DOMAIN domain_constraint to spell out options
bmomjian Nov 1, 2024
bc6bad8
Revert "WAL-log inplace update before revealing it to other sessions."
nmisch Nov 2, 2024
c1099dd
Revert "For inplace update, send nontransactional invalidations."
nmisch Nov 2, 2024
0bcb9d0
Move I/O before the index_update_stats() buffer lock region.
nmisch Nov 2, 2024
54bc22f
Suppress new "may be used uninitialized" warning.
nmisch Nov 3, 2024
9ad2f3c
Stabilize jsonb_path_query test case.
tglsfdc Oct 30, 2024
0d635b6
pg_combinebackup: When reconstructing, avoid double slash in filename.
robertmhaas Nov 4, 2024
e367114
pg_combinebackup: Error if incremental file exists in full backup.
robertmhaas Nov 4, 2024
e2a9129
pg_basebackup, pg_receivewal: fix failure to find password in ~/.pgpass.
tglsfdc Nov 4, 2024
811f8d3
Use portable diff options in pg_bsd_indent's regression test.
tglsfdc Nov 4, 2024
7f3b41c
Clear padding of PgStat_HashKey when handling pgstats entries
michaelpq Nov 5, 2024
b7467ab
Monkey-patch LLVM code to fix ARM relocation bug.
macdice Nov 6, 2024
8148e71
Fix lc_collate_is_c() when LC_COLLATE != LC_CTYPE.
jeff-davis Nov 6, 2024
e2b5693
doc: Reword ALTER TABLE ATTACH restriction on NO INHERIT constraints
alvherre Nov 7, 2024
78b1c55
Fix inconsistent RestrictInfo serial numbers
Nov 8, 2024
b6484ca
Disallow partitionwise grouping when collations don't match
amitlan Nov 8, 2024
a0cdfc8
Disallow partitionwise join when collations don't match
amitlan Nov 8, 2024
943b653
Improve fix for not entering parallel mode when holding interrupts.
tglsfdc Nov 8, 2024
4145ea0
First-draft release notes for 17.1.
tglsfdc Nov 8, 2024
0a883a0
Fix sign-compare warnings in pg_iovec.h.
nathan-bossart Nov 8, 2024
ca19f88
Release notes for 17.1, 16.5, 15.9, 14.14, 13.17, 12.21.
tglsfdc Nov 10, 2024
a5cc4c6
libpq: Bail out during SSL/GSS negotiation errors
michaelpq Nov 11, 2024
6bf5bf1
Translation updates
petere Nov 11, 2024
3ebcfa5
Block environment variable mutations from trusted PL/Perl.
nmisch Nov 11, 2024
edcda9b
Ensure cached plans are correctly marked as dependent on role.
nathan-bossart Nov 11, 2024
cd82afd
Fix improper interactions between session_authorization and role.
tglsfdc Nov 11, 2024
4cd4f3b
Avoid bizarre meson behavior with backslashes in command arguments.
tglsfdc Nov 11, 2024
8d19f3f
Fix cross-version upgrade tests.
tglsfdc Nov 11, 2024
37de60d
Do not wallog AUX files at replica (#517)
knizhnik Nov 11, 2024
ae4cc30
Log the replication slot's confirmed_flush LSN when it is saved
tristan957 Oct 31, 2024
f4f5d27
Parallel workers use AuthenticatedUserId for connection privilege che…
tglsfdc Nov 11, 2024
052aa02
Last-minute updates for release notes.
tglsfdc Nov 11, 2024
91f20bc
Stamp 17.1.
tglsfdc Nov 11, 2024
a6fa869
Fix arrays comparison in CompareOpclassOptions()
akorotkov Nov 11, 2024
7af6d13
Count contrib/bloom index scans in pgstat view.
petergeoghegan Nov 13, 2024
73731b2
Fix comment in injection_point.c
michaelpq Nov 13, 2024
aa2e29f
Merge tag 'REL_17_1' into minor-update-17
hlinnaka Nov 13, 2024
1d6a03e
Fix race conditions with drop of reused pgstats entries
michaelpq Nov 15, 2024
cb844d6
Avoid deleting critical WAL segments during pg_rewind
alvherre Nov 15, 2024
5f28e6b
Avoid assertion due to disconnected NFA sub-graphs in regex parsing.
tglsfdc Nov 15, 2024
568e78a
Fix a possibility of logical replication slot's restart_lsn going bac…
MasahikoSawada Nov 16, 2024
1c05004
Fix per-session activation of ALTER {ROLE|DATABASE} SET role.
nmisch Nov 16, 2024
6bfacd3
Undo unintentional ABI break in struct ResultRelInfo.
tglsfdc Nov 16, 2024
9ac1003
Release notes for 17.2, 16.6, 15.10, 14.15, 13.18, 12.22.
tglsfdc Nov 16, 2024
6304632
Stamp 17.2.
tglsfdc Nov 18, 2024
a05dc13
Merge tag 'REL_17_2' into minor-update-v17
hlinnaka Nov 18, 2024
3c15b65
Register custom xlog reader callbacks for on-demand WAL download in S…
Sep 16, 2024
fb5e9d0
Fix seqscan prefetch for pg17
knizhnik Nov 24, 2024
d129d7f
Implement prefetch for seqscan
Nov 24, 2024
98783ec
Use scan->rs_prefetch_block
knizhnik Nov 24, 2024
56d0767
Change assignment of scan_pageoff
knizhnik Nov 25, 2024
cb62fe5
Reoplace assert with check that prefetched blocks fits in scan range
Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Correctly identify which EC members are computable at a plan node.
find_computable_ec_member() had the wrong mental model of what
its primary caller prepare_sort_from_pathkeys() would do with
the selected EquivalenceClass member expression.  We will not
compute the EC expression in a plan node atop the one returning
the passed-in targetlist; rather, the EC expression will be
computed as an additional column of that targetlist.  So any
Var or quasi-Var used in the given tlist is also available to the
EC expression.  In simple cases this makes no difference because
the given tlist is just a list of Vars or quasi-Vars --- but if
we are considering an appendrel member produced by flattening
a UNION ALL, the tlist may contain expressions, resulting in
failure to match and a "could not find pathkey item to sort"
error.

To fix, we can flatten both the tlist and the EC members with
pull_var_clause(), and then just check for subset-ness, so
that the code is actually shorter than before.

While this bug is quite old, the present patch only works back to
v13.  We could possibly make it work in v12 by back-patching parts
of 3753982.  On the whole though I don't like the risk/reward
ratio of that idea.  v12's final release is next month, meaning
there would be no chance to correct matters if the patch causes a
regression.  Since this failure has escaped notice for 14 years,
it's likely nobody will hit it in the field with v12.

Per bug #18652 from Alexander Lakhin.

Andrei Lepikhov and Tom Lane

Discussion: https://postgr.es/m/18652-deaa782ebcca85d1@postgresql.org
tglsfdc committed Oct 12, 2024
commit 54889ea64baaa5970330a0097fb6689ee1af7591
71 changes: 33 additions & 38 deletions src/backend/optimizer/path/equivclass.c
Original file line number Diff line number Diff line change
@@ -38,7 +38,6 @@ static EquivalenceMember *add_eq_member(EquivalenceClass *ec,
JoinDomain *jdomain,
EquivalenceMember *parent,
Oid datatype);
static bool is_exprlist_member(Expr *node, List *exprs);
static void generate_base_implied_equalities_const(PlannerInfo *root,
EquivalenceClass *ec);
static void generate_base_implied_equalities_no_const(PlannerInfo *root,
@@ -806,9 +805,18 @@ find_ec_member_matching_expr(EquivalenceClass *ec,
* expressions appearing in "exprs"; return NULL if no match.
*
* "exprs" can be either a list of bare expression trees, or a list of
* TargetEntry nodes. Either way, it should contain Vars and possibly
* Aggrefs and WindowFuncs, which are matched to the corresponding elements
* of the EquivalenceClass's expressions.
* TargetEntry nodes. Typically it will contain Vars and possibly Aggrefs
* and WindowFuncs; however, when considering an appendrel member the list
* could contain arbitrary expressions. We consider an EC member to be
* computable if all the Vars, PlaceHolderVars, Aggrefs, and WindowFuncs
* it needs are present in "exprs".
*
* There is some subtlety in that definition: for example, if an EC member is
* Var_A + 1 while what is in "exprs" is Var_A + 2, it's still computable.
* This works because in the final plan tree, the EC member's expression will
* be computed as part of the same plan node targetlist that is currently
* represented by "exprs". So if we have Var_A available for the existing
* tlist member, it must be OK to use it in the EC expression too.
*
* Unlike find_ec_member_matching_expr, there's no special provision here
* for binary-compatible relabeling. This is intentional: if we have to
@@ -828,12 +836,24 @@ find_computable_ec_member(PlannerInfo *root,
Relids relids,
bool require_parallel_safe)
{
List *exprvars;
ListCell *lc;

/*
* Pull out the Vars and quasi-Vars present in "exprs". In the typical
* non-appendrel case, this is just another representation of the same
* list. However, it does remove the distinction between the case of a
* list of plain expressions and a list of TargetEntrys.
*/
exprvars = pull_var_clause((Node *) exprs,
PVC_INCLUDE_AGGREGATES |
PVC_INCLUDE_WINDOWFUNCS |
PVC_INCLUDE_PLACEHOLDERS);

foreach(lc, ec->ec_members)
{
EquivalenceMember *em = (EquivalenceMember *) lfirst(lc);
List *exprvars;
List *emvars;
ListCell *lc2;

/*
@@ -851,18 +871,18 @@ find_computable_ec_member(PlannerInfo *root,
continue;

/*
* Match if all Vars and quasi-Vars are available in "exprs".
* Match if all Vars and quasi-Vars are present in "exprs".
*/
exprvars = pull_var_clause((Node *) em->em_expr,
PVC_INCLUDE_AGGREGATES |
PVC_INCLUDE_WINDOWFUNCS |
PVC_INCLUDE_PLACEHOLDERS);
foreach(lc2, exprvars)
emvars = pull_var_clause((Node *) em->em_expr,
PVC_INCLUDE_AGGREGATES |
PVC_INCLUDE_WINDOWFUNCS |
PVC_INCLUDE_PLACEHOLDERS);
foreach(lc2, emvars)
{
if (!is_exprlist_member(lfirst(lc2), exprs))
if (!list_member(exprvars, lfirst(lc2)))
break;
}
list_free(exprvars);
list_free(emvars);
if (lc2)
continue; /* we hit a non-available Var */

@@ -880,31 +900,6 @@ find_computable_ec_member(PlannerInfo *root,
return NULL;
}

/*
* is_exprlist_member
* Subroutine for find_computable_ec_member: is "node" in "exprs"?
*
* Per the requirements of that function, "exprs" might or might not have
* TargetEntry superstructure.
*/
static bool
is_exprlist_member(Expr *node, List *exprs)
{
ListCell *lc;

foreach(lc, exprs)
{
Expr *expr = (Expr *) lfirst(lc);

if (expr && IsA(expr, TargetEntry))
expr = ((TargetEntry *) expr)->expr;

if (equal(node, expr))
return true;
}
return false;
}

/*
* relation_can_be_sorted_early
* Can this relation be sorted on this EC before the final output step?
30 changes: 30 additions & 0 deletions src/test/regress/expected/inherit.out
Original file line number Diff line number Diff line change
@@ -1677,6 +1677,36 @@ select min(1-id) from matest0;

reset enable_seqscan;
reset enable_parallel_append;
explain (verbose, costs off) -- bug #18652
select 1 - id as c from
(select id from matest3 t1 union all select id * 2 from matest3 t2) ss
order by c;
QUERY PLAN
------------------------------------------------------------
Result
Output: ((1 - t1.id))
-> Merge Append
Sort Key: ((1 - t1.id))
-> Index Scan using matest3i on public.matest3 t1
Output: t1.id, (1 - t1.id)
-> Sort
Output: ((t2.id * 2)), ((1 - (t2.id * 2)))
Sort Key: ((1 - (t2.id * 2)))
-> Seq Scan on public.matest3 t2
Output: (t2.id * 2), (1 - (t2.id * 2))
(11 rows)

select 1 - id as c from
(select id from matest3 t1 union all select id * 2 from matest3 t2) ss
order by c;
c
-----
-11
-9
-5
-4
(4 rows)

drop table matest0 cascade;
NOTICE: drop cascades to 3 other objects
DETAIL: drop cascades to table matest1
8 changes: 8 additions & 0 deletions src/test/regress/sql/inherit.sql
Original file line number Diff line number Diff line change
@@ -601,6 +601,14 @@ select min(1-id) from matest0;
reset enable_seqscan;
reset enable_parallel_append;

explain (verbose, costs off) -- bug #18652
select 1 - id as c from
(select id from matest3 t1 union all select id * 2 from matest3 t2) ss
order by c;
select 1 - id as c from
(select id from matest3 t1 union all select id * 2 from matest3 t2) ss
order by c;

drop table matest0 cascade;

--