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

Universal wal format v14 #305

Open
wants to merge 1,397 commits into
base: REL_15_STABLE_neon
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
1397 commits
Select commit Hold shift + click to select a range
49d1d3c
doc: PG _14_ relnotes, remove duplicate commit comment
bmomjian Jun 30, 2023
c1affa3
Fix memory leak in Incremental Sort rescans
tvondra Jul 2, 2023
260dbf1
Fix oversight in handling of modifiedCols since f24523672d
tvondra Jul 2, 2023
c8987ea
Make PG_TEST_NOCLEAN work for temporary directories in TAP tests
michaelpq Jul 3, 2023
83ed4de
Improve pg_basebackup long file name test Windows robustness
adunstan Jul 3, 2023
8d3e171
Use older package name in pg_basebackup test
adunstan Jul 3, 2023
5396b18
Remove expensive test of postgres_fdw batch inserts
tvondra Jul 3, 2023
ae6d536
Fix race in SSI interaction with empty btrees.
macdice Jul 3, 2023
3f7d3a7
Fix race in SSI interaction with bitmap heap scan.
macdice Jul 3, 2023
fb663f3
Fix race in SSI interaction with gin fast path.
macdice Jul 3, 2023
b7ec667
Re-bin segment when memory pages are freed.
macdice Jul 4, 2023
070bf5c
Adjust kerberos and ldap tests for Homebrew on ARM
petere Jul 4, 2023
d85bf07
Ensure that creation of an empty relfile is fsync'd at checkpoint.
hlinnaka Jul 4, 2023
bfb493d
Fix leak of LLVM "fatal-on-oom" section counter.
hlinnaka Jul 5, 2023
cf3e298
Revert the commits related to allowing page lock to conflict among pa…
Jul 6, 2023
32f327f
WAL-log the creation of the init fork of unlogged indexes.
hlinnaka Jul 6, 2023
fb0f055
Skip pg_baseback long filename test if path too long on Windows
adunstan Jul 6, 2023
1508b57
Fix type of iterator variable in SH_START_ITERATE
anarazel Jul 6, 2023
38342df
Use shorter location for pg_replslot in pg_basebackup test
adunstan Jul 8, 2023
75414c6
Fix tmpdir issues with commit e213de8e78
adunstan Jul 8, 2023
571377d
Doc: update old reference to "result cache"
david-rowley Jul 9, 2023
235e716
Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's sc…
michaelpq Jul 10, 2023
48582cf
Be more rigorous about local variables in PostgresMain().
tglsfdc Jul 10, 2023
a6991f7
Remove unnecessary pfree() in g_intbig_compress().
tglsfdc Jul 13, 2023
e246fd4
Release lock after encountering bogs row in vac_truncate_clog()
anarazel Jul 13, 2023
d11efe8
Handle DROP DATABASE getting interrupted
anarazel Jul 13, 2023
954cc21
Fix updates of indisvalid for partitioned indexes
michaelpq Jul 14, 2023
7af6552
Add indisreplident to fields refreshed by RelationReloadIndexInfo()
michaelpq Jul 14, 2023
4427491
Fix recovery of 2PC transaction during crash recovery
michaelpq Jul 18, 2023
763d262
Fix indentation in twophase.c
michaelpq Jul 18, 2023
2e9135b
Doc: fix out-of-date example of SPI usage.
tglsfdc Jul 18, 2023
8286b43
Doc: improve description of IN and row-constructor comparisons.
tglsfdc Jul 19, 2023
10fd061
Guard against null plan pointer in CachedPlanIsSimplyValid().
tglsfdc Jul 20, 2023
c5c5832
Make test_decoding ddl.out shorter
alvherre Jul 24, 2023
3419962
Raise fixed token-length limit in hba.c.
tglsfdc Jul 27, 2023
b0e390e
Disallow replacing joins with scans in problematic cases.
Jul 28, 2023
f457f2e
Fix overly strict Assert in jsonpath code
david-rowley Aug 1, 2023
2e3741f
Fix ReorderBufferCheckMemoryLimit() comment.
MasahikoSawada Aug 2, 2023
1ea0424
Update comments on CustomPath struct.
Aug 3, 2023
1ecd743
Doc: update documentation for creating custom scan paths.
Aug 3, 2023
7c9f0c0
Release notes for 15.4, 14.9, 13.12, 12.16, 11.21.
tglsfdc Aug 5, 2023
bf31535
Don't Memoize lateral joins with volatile join conditions
david-rowley Aug 7, 2023
6186e27
Translation updates
petere Aug 7, 2023
d4648a7
Reject substituting extension schemas or owners matching ["$'\].
nmisch Aug 7, 2023
93eb661
Last-minute updates for release notes.
tglsfdc Aug 7, 2023
86648dc
Stamp 14.9.
tglsfdc Aug 7, 2023
474e903
[smgr_api] [community] smgr_api.patch
lubennikovaav May 16, 2021
b219a36
[contrib/zenith] contrib_zenith.patch
lubennikovaav May 16, 2021
6b7ac22
[walredo] zenith_wal_redo.patch
lubennikovaav May 16, 2021
133bc26
lastWrittenPageLSN.patch
lubennikovaav May 16, 2021
2f35fe7
Fix GetPage requests right after replaying CREATE DATABASE
hlinnaka May 21, 2021
5e0e23d
handle_eviction_of_non_wal_logged_pages.patch
lubennikovaav May 16, 2021
81c62a0
[walproposer] wal_proposer.patch
lubennikovaav May 16, 2021
40fbd04
persist_unlogged_tables.patch
lubennikovaav May 16, 2021
7c31459
fix_pg_table_size.patch
lubennikovaav May 16, 2021
b0bf748
[walredo] fix_gin_redo.patch
lubennikovaav May 16, 2021
aab45cd
[walredo] fix_brin_redo.patch
lubennikovaav May 16, 2021
cc15c8b
speculative_records_workaround.patch
lubennikovaav May 16, 2021
bf0ea07
wallog_t_ctid.patch
lubennikovaav May 16, 2021
ec5953c
vacuumlazy_debug_stub.patch
lubennikovaav May 16, 2021
4ddd6e2
[test] zenith_test_evict.patch
lubennikovaav May 16, 2021
799605b
fix_sequence_wallogging.patch
lubennikovaav May 16, 2021
4acde0a
Bring back change that got lost in refactoring. silence ReadBuffer_co…
lubennikovaav May 18, 2021
8fbbe81
[contrib/zenith] [refer #225] if insert WAL position points at the en…
knizhnik Jun 7, 2021
ad3f9d5
[walproposer] Create replication slot for walproposer to avoid loose …
knizhnik Jun 8, 2021
e102021
[walproposer] Skip absent WAL segment removed by pg_resetwal
lubennikovaav Aug 17, 2021
528d10f
[walproposer] Fix breaking out of WalProposerPoll and WaitEventSetWai…
arssher Jun 11, 2021
20cad8a
[walproposer] Make it possible to start postgres without reading chec…
knizhnik Jun 17, 2021
a645787
[walproposer] Simplify WL_LATCH_SET testing in the walproposer
ololobus Jul 5, 2021
0e85316
[walredo] Add basic support for Seccomp BPF mode
funbringer Jun 24, 2021
70eeea0
[smgr_api] [contrib/zenith] 1. Do not call mdinit from smgrinit() bec…
knizhnik Jul 9, 2021
360d394
[walproposer] [contrib/zenith] support zenith_tenant
LizardWizzard Jul 15, 2021
ceb5b0d
[walproposer] Remove graceful termination of COPY during walproposer …
arssher Aug 4, 2021
c5f6539
[walproposer] [contrib/zenith] [refer #395] Do no align sart replicat…
knizhnik Aug 9, 2021
80b3e88
[test] Add contrib/zenith_test_utils with helpers for testing and deb…
lubennikovaav Aug 10, 2021
2bd2e3e
[walproposer] Change condition for triggering recovery
knizhnik Aug 11, 2021
fd27a08
[contrib/zenith] Use authentication token passed as environment varia…
LizardWizzard Aug 4, 2021
cfd9ae0
[contrib/zenith] Fix race condition while WAL-logging page, leading t…
hlinnaka Aug 13, 2021
7a3032e
[walproposer] Rework walkeeper protocol to use libpq (#60)
sharnoff Aug 13, 2021
d2ba210
Build zenithdb/compute-node:latest in CI (zenithdb/console#125)
ololobus Aug 16, 2021
ca356e7
zenith_regression_tests.patch
lubennikovaav Aug 23, 2021
d5d21d4
Add test function to flush the shared buffer cache.
hlinnaka Aug 24, 2021
5d25720
Basic safekeeper refactoring and bug fixing.
arssher Aug 17, 2021
bff1640
Rename VCL to epochStartLsn and restart_lsn to truncate_lsn.
arssher Aug 27, 2021
af48ef0
[refer #27] Implement shared relsize cache to improve zenith performa…
knizhnik Aug 3, 2021
045af1f
Cleanup walproposer changes from #60
sharnoff Aug 31, 2021
e6248d9
pass tenant id in connection string to safekeeper
LizardWizzard Aug 31, 2021
551be8d
Ask pageserver only with LSN's aligned on record boundary.
kelvich Aug 31, 2021
c6664b6
[refer #506] Correctly initialize all fields of WAL page header for f…
knizhnik Sep 1, 2021
480a912
Add --sync-safekeepers starting standalone walproposer to sync safeke…
knizhnik Aug 19, 2021
7a0c9b7
Update Dockerfile
ololobus Aug 27, 2021
83e2f78
Fix compiler warnings in walproposer.c
ololobus Sep 10, 2021
1db3887
Always advance truncateLsn to commitLsn, keeping it on record boundary.
arssher Sep 9, 2021
7213b0d
Minor logging editing.
arssher Sep 10, 2021
871bd54
Fix walproposer starting streaming point.
arssher Sep 10, 2021
1bee494
Mark all recovery messages as received by the donor.
arssher Sep 14, 2021
0d471d1
Don't FATAL in walproposer when EOF arrives in SS_IDLE state.
arssher Sep 14, 2021
22e79be
Optimize walproposer starting streaming point.
arssher Sep 15, 2021
c939c15
Silence compiler warnings:
hlinnaka Sep 17, 2021
75a4500
Remove unused functions for reading non-rel pages.
hlinnaka Sep 17, 2021
b89ccf4
Misc cleanup in the code that communicates with the page server.
hlinnaka Sep 17, 2021
be4bcf2
Improve the protocol between Postgres and page server.
hlinnaka Sep 17, 2021
8661672
Run 'pgindent' on zenith-specific code in contrib/zenith and in walpr…
hlinnaka Sep 17, 2021
7b8f9a8
Fix a badly worded comment
hlinnaka Sep 20, 2021
8e09e9f
Simplify a2e929e by storing starting point in walkeeper itself.
arssher Sep 16, 2021
7c879b6
Catch walkeeper ErrorResponse in PQgetCopyData
sharnoff Sep 22, 2021
9953e76
Use buffered I/O for reading commands from stdin.
hlinnaka Sep 24, 2021
f1fd832
Replace fread() with plain read() and a hand-written buffer.
hlinnaka Sep 30, 2021
cca4552
Store unlogged tables locally, and replace PD_WAL_LOGGED.
hlinnaka Oct 6, 2021
736f45f
Fix queue cleanup in proposer (#93)
petuhovskiy Oct 14, 2021
7ab3368
Support read-only nodes
hlinnaka Oct 19, 2021
a27548e
Remove a drop of syncSafekeepers complexity.
arssher Oct 21, 2021
3ba1e8b
Fix compiler warning.
arssher Oct 21, 2021
c674ea2
Implement backpressure for compute node to avoid WAL overflow
knizhnik Sep 18, 2021
44bc91b
Initialize FSM/VM pages through buffer cache
ololobus Oct 19, 2021
968a088
Turn off back pressure by default
ololobus Oct 21, 2021
33f68cb
ShutdownConnection instead of ResetConnection in more places.
arssher Oct 21, 2021
7e7fe1b
Handle partial writes to stdout in WAL redo process.
hlinnaka Nov 3, 2021
4bf144e
Handle keepalives while receiving WAL in recovery.
arssher Nov 8, 2021
0694f7e
Fix truncateLsn update (#101)
petuhovskiy Nov 9, 2021
e2ea967
[walproposer] Get rid of SAB_Error after rebase
ololobus Nov 10, 2021
f7c4bf9
Add term history to safekeepers.
arssher Nov 5, 2021
6e4892e
Clarify the meaning of StandbyReply LSNs used for backpressure
lubennikovaav Nov 9, 2021
560de58
Use max_replication_apply_lag instead of max_replication_write_lag.
lubennikovaav Nov 11, 2021
bbcfd59
Forward pageserver connection string to safekeeper
LizardWizzard Nov 25, 2021
4e59384
Move backpressure throttling to ProcessInterrupts()
lubennikovaav Nov 26, 2021
a1c3123
Stop building docker images in this repo.
kelvich Dec 15, 2021
425c935
[walproposer] Async WAL append (#105)
petuhovskiy Dec 21, 2021
9e042aa
Fix walsender to work with zenith style standbyReply that sends non-z…
lubennikovaav Dec 22, 2021
2b70e2a
Do not copy the obsolete apply_conf binary into Docker image
ololobus Dec 25, 2021
837ed15
Reorder walproposer code in a more natural order (#112)
petuhovskiy Dec 31, 2021
5c7a167
Simplify walproposer code (#114)
petuhovskiy Jan 4, 2022
18c1caf
Don't change propTerm after quorum is acquired (#107)
petuhovskiy Jan 4, 2022
266b749
walproposer renames (#116)
petuhovskiy Jan 5, 2022
e7e1d71
Report back-pressure trottling status of backend
knizhnik Dec 29, 2021
da71316
Add max_replication_write_lag
knizhnik Dec 29, 2021
7083c2d
Do not throttle wal sender
knizhnik Jan 10, 2022
e2ee5f7
Don't track acks in walproposer (#119)
petuhovskiy Jan 13, 2022
83e36ba
Silence excessively noisy logging from walproposer.
hlinnaka Jan 14, 2022
8faab8b
Extend replication protocol with ZenithFeedback message.
lubennikovaav Dec 20, 2021
2ed0449
Allow to join empty safekeeper to existing cluster (#123)
petuhovskiy Jan 27, 2022
65a45be
Use local relation cache for smgr_exists
knizhnik Dec 29, 2021
97917c3
Reduce walproposer logging after ca5e7beaf.
arssher Feb 4, 2022
28e6072
Implement cluster size quota for zenith compute node.
lubennikovaav Dec 20, 2021
ea48c92
Revert "Use local relation cache for smgr_exists"
arssher Feb 9, 2022
9c329b1
Change the unit of cluster size limit GUC to MB, and other fixes.
hlinnaka Feb 9, 2022
bb12e59
Improve error handling while connecting to page server.
hlinnaka Feb 9, 2022
f696f32
Make getpage requests interruptible.
hlinnaka Feb 9, 2022
6202ca9
Fix memory leak of messages received from safekeepers.
hlinnaka Feb 10, 2022
5f372ba
Initialize pgxactoff for walproposer
knizhnik Feb 11, 2022
d5ca16d
Fix compilation warning after 8524105dc.
arssher Feb 14, 2022
37ace89
Fix more compiler warnings.
arssher Feb 14, 2022
30bda33
Remove dead code in handling ZenithFeedback part of an AppendResponse.
hlinnaka Feb 16, 2022
6bedf95
Expose reading a relation page at a specific LSN (#131)
antons-antons Feb 18, 2022
87d6723
Add backpressure_lsns() function. Fix zenith feedback processing
lubennikovaav Feb 17, 2022
423b877
Fix zenith_test_utils linkage on macOS
kelvich Feb 23, 2022
73aef20
Add warning fr unrecgonized GUCs with zenith prefix
knizhnik Feb 21, 2022
23091c5
Count WAL flushes in walreceiver (#139)
petuhovskiy Mar 8, 2022
06b08bc
Use local relation cache for smgr_exists
knizhnik Dec 29, 2021
01dd0f8
Populate relsize cache when relation is created.
hlinnaka Mar 10, 2022
a011c6c
Fix pg_table_size() on a view
hlinnaka Mar 28, 2022
19a77c5
Don't set commitLsn to truncateLsn.
arssher Mar 28, 2022
281c226
Raise fatal error on failed recovery (#147)
petuhovskiy Mar 31, 2022
ee31c09
Enable dumping corrupt WAL segments (#145)
antons-antons Apr 1, 2022
573dfe5
Don't hold walproposer WAL in memory (#141)
petuhovskiy Apr 4, 2022
0362f13
Add --sysid parameter to initdb
knizhnik Jan 27, 2022
f6a66d8
Give up connection attempt to safekeeper after timeout.
arssher Apr 15, 2022
0715d9f
Avoid redundand memory allocation and sycnhronization in walredo (#144)
knizhnik Apr 23, 2022
1c7552a
Fix missed include for InRecovery (#149)
knizhnik Apr 25, 2022
5d69822
Avoid "bad syscall 39" on assertion failure in WAL redo process.
hlinnaka Apr 26, 2022
84c03fd
Add error context, if replaying a WAL record fails in WAL redo process.
hlinnaka Apr 26, 2022
2f687cb
Add WARNING for debugging purposes.
hlinnaka Apr 26, 2022
40d9ef6
Turn Assertion into elog(ERROR), to help with debugging.
hlinnaka Apr 26, 2022
2b94539
Fix errors in WAL redo about relpersistence mismatch.
hlinnaka Apr 26, 2022
824555c
Don't log 'last written LSN ahead of flushed'.
arssher Apr 26, 2022
973306c
Perform inmem_smgr cleaup after processing each record (#154)
knizhnik Apr 27, 2022
866c558
Avoid extending relation in the WAL redo process.
hlinnaka May 3, 2022
f162841
Send timeline_start_lsn in Elected and receive it in VoteResponse mes…
arssher May 1, 2022
678bf63
Verify basebackup LSN against consensus LSN in walproposer.
arssher May 2, 2022
b87ee98
Implement pg_database_size():
lubennikovaav Jul 23, 2021
7d97799
Shut down instance on basebackup LSN mismatch.
arssher May 6, 2022
5ae434e
Use compute-tools from the new neondatabase Docker Hub repo
ololobus May 9, 2022
2293bd2
zenith_test_utils extension: add neon_xlogflush()
yeputons May 10, 2022
7e6aac7
Reduce noise in the logs from inmem_write()
hlinnaka May 13, 2022
db664f1
Use compute_ctl instead of zenith_ctl (#162)
ololobus May 18, 2022
9a02f82
Improve error messages on seccomp loading errors.
hlinnaka May 24, 2022
bcf81f9
Rename contrib/zenith to contrib/neon. Rename custom GUCs:
lubennikovaav May 26, 2022
6ca3342
Rename 'wal_acceptors' GUC to 'safekeepers'
lubennikovaav Apr 19, 2022
d5e8706
Fix basebackup LSN comparison in walproposer.
arssher May 31, 2022
e03e344
Allow specifiyng the different compute-tools tag (#170)
ololobus May 31, 2022
83a4536
Do not allocate shared memory for wal_redo process (#165)
knizhnik Jun 6, 2022
7f7dd42
Add check for NULL for malloc in InternalIpcMemoryCreate (#173)
knizhnik Jun 8, 2022
42c6df5
Rename ZenithFeedback (#174)
SomeoneToIgnore Jun 10, 2022
17292f7
Remove callmemaybe bits from compute (#172)
SomeoneToIgnore Jun 10, 2022
0f39d8d
Panic on receiving higher term (#176)
petuhovskiy Jun 22, 2022
3319869
Misc cleanup in libpagestore.c.
hlinnaka May 16, 2022
7a86952
Large last written lsn cache (#177)
knizhnik Jul 9, 2022
d44615a
Add uuid-ossp to the supported extensions (#181)
MMeent Jul 12, 2022
300604d
Update last written LSN for gin/gist index metadata (#182)
knizhnik Jul 19, 2022
8857e32
Revert "Update last written LSN for gin/gist index metadata (#182)" (…
knizhnik Jul 26, 2022
0954098
Fix `uuid-ossp` build
kelvich Aug 1, 2022
547aea1
Remove redundant const (#189)
bojanserafimov Aug 8, 2022
0207f52
Eliminate UnkonwnXLogRecPtr and always use InvalidXLogRecPtr instead …
knizhnik Aug 12, 2022
5ea5c63
Init wal redo buffer for fpi (#194)
knizhnik Aug 15, 2022
52c4257
Stamp XLP_FIRST_IS_CONTRECORD only if we start writing with page offset.
arssher Aug 14, 2022
934bb11
Pull 99% of walproposer code into extension. (#188)
MMeent Aug 18, 2022
b1114a5
Use ECR for image (#195)
zoete Aug 19, 2022
8f51c0d
walproposer: do not send pageserver connstring with START_WAL_PUSH (#…
yeputons Aug 25, 2022
af47bb0
Remove neon extensions from the vendor repo (#197)
MMeent Aug 25, 2022
c2a7b65
Remove Dockerfile, it's now in the neon repo (#199)
ololobus Aug 26, 2022
05e8736
Move backpressure throttling implementation to neon extension (#203)
knizhnik Sep 2, 2022
a21cce2
Merge last written cache lsn with new main branch (#201)
knizhnik Sep 4, 2022
216c3e9
Local prefetch implementation for Postgres 14
knizhnik Sep 12, 2022
b52388c
Disable prefetch by default to make it possible to early merge this P…
knizhnik Sep 12, 2022
2a1b9f3
Disable prefetch by default to make it possible to early merge this P…
knizhnik Sep 12, 2022
2af88d0
Update expected output for sysviews test because of changed default v…
knizhnik Sep 12, 2022
6381c11
Set last written page lsn for created relation (#209)
knizhnik Sep 16, 2022
f074df5
Undo diasming VM check warning in vacuumlazy.c (#213)
knizhnik Sep 20, 2022
163c031
Pin pages with speculative insert tuples to prevent their reconstruct…
knizhnik Oct 20, 2022
b057a76
Fix shared memory initialization for last written LSN cache (#224)
knizhnik Oct 24, 2022
939c80d
Fix upper boundary caculation in the chunks loop in SetLastWrittenLSN…
knizhnik Oct 28, 2022
5fb6bd4
Move walredo process code under pgxn in the main 'neon' repository.
hlinnaka Oct 31, 2022
cfb1340
Misc cleanup, mostly to reduce unnecessary differences with upstream.
hlinnaka Oct 31, 2022
c4051a5
Optimize prefetch patterns in both heap seqscan and vacuum scans. (#227)
MMeent Nov 7, 2022
90e5643
Fix prefetch issues in parallel scans and vacuum's cleanup scan (#234)
MMeent Nov 11, 2022
b475ed2
Use prefetch in pg_prewarm extension (#236)
knizhnik Nov 17, 2022
153e2eb
PG14: Prefetch cleanup (#242)
MMeent Nov 23, 2022
ff0e27b
Do not produce open file error for unlogged relations (#239)
knizhnik Nov 24, 2022
148a229
Maintain last written LSN for each page to enable prefetch on vacuum,…
knizhnik Nov 24, 2022
baa1b4f
Prefetch cleanup: (#247)
MMeent Dec 5, 2022
1f81804
Fix uninitialized variable in spgvacuum.c (#250)
MMeent Dec 7, 2022
fccd2bf
Update heap pge LSN in case of VM changes even if wal_redo_hints=off …
knizhnik Dec 8, 2022
0b37209
Show prefetch statistic in EXPLAIN (#248)
knizhnik Jan 12, 2023
05637e2
Implement efficient prefetch for parallel bitmap heap scan (#258)
knizhnik Feb 14, 2023
20ea92a
Unlogged index fix v14 (#259)
knizhnik Feb 22, 2023
5ef9694
Fix bitmap scan prefetch (#260)
knizhnik Feb 23, 2023
93c9163
Revert handling of UNLOGGED tables on compute side.
arssher Feb 24, 2023
e3feaea
Allow external main functions to skip config load and make last
kelvich Feb 23, 2023
59028c3
Remove walredo-related hacks from InternalIpcMemoryCreate()
kelvich Mar 6, 2023
c853d40
Adjust prefetch target for parallel bitmap scan (#273)
knizhnik Mar 27, 2023
1c7dcdb
Heap bitmap scan prefetch fix2 v14 (#275)
knizhnik Apr 7, 2023
1ba50fc
Implement index prefetch for index and index-only scans (#277)
knizhnik Apr 7, 2023
fa73f4f
[PG14] Feature/replicas (#278)
MMeent Apr 13, 2023
662d028
Do not allow users with CREATEROLE privelege to manage system user
kelvich Jul 7, 2023
00e164d
Fix regression tests after the patch with CREATEROLE restrictions
kelvich Jul 15, 2023
afa353a
Make it possible to grant self created roles (#297)
knizhnik Jul 26, 2023
07873a7
Define NEON_SMGR in smgr.h to make it possible for extensions to use …
knizhnik Jul 29, 2023
5d5cfee
Request extension files and libraries from compute_ctl
lubennikovaav Jun 13, 2023
d5df566
Handle both Vanilla and Neon WAL formats
Aug 15, 2023
71126b9
Support work with both multi_insert record formats in compatibility mode
Aug 15, 2023
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
Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's sc…
…hema

As coded, the code would use as a base comparison the namespace OID from
the first object scanned in pg_depend when switching its namespace
dependency entry to the new one, and use it as a base of comparison for
any follow-up checks.  It would also be used as the old namespace OID to
switch *from* for the extension's pg_depend entry.  Hence, if the first
object scanned has a namespace different than the one stored in the
extension, we would finish by:
- Not checking that the extension objects map with the extension's
schema.
- Not switching the extension -> namespace dependency entry to the new
namespace provided by the user, making ALTER EXTENSION ineffective.

This issue exists since this command has been introduced in d9572c4 for
relocatable extension, so backpatch all the way down to 11.  The test
case has been provided by Heikki, that I have tweaked a bit to show the
effects on pg_depend for the extension.

Reported-by: Heikki Linnakangas
Author: Michael Paquier, Heikki Linnakangas
Discussion: https://postgr.es/m/20eea594-a05b-4c31-491b-007b6fceef28@iki.fi
Backpatch-through: 11
  • Loading branch information
michaelpq committed Jul 10, 2023
commit 235e716bc24df2fbc89f0e99a29f63ec4c58772c
11 changes: 4 additions & 7 deletions src/backend/commands/extension.c
Original file line number Diff line number Diff line change
@@ -2789,7 +2789,7 @@ AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *o
{
Oid extensionOid;
Oid nspOid;
Oid oldNspOid = InvalidOid;
Oid oldNspOid;
AclResult aclresult;
Relation extRel;
ScanKeyData key[2];
@@ -2872,6 +2872,9 @@ AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *o

objsMoved = new_object_addresses();

/* store the OID of the namespace to-be-changed */
oldNspOid = extForm->extnamespace;

/*
* Scan pg_depend to find objects that depend directly on the extension,
* and alter each one's schema.
@@ -2917,12 +2920,6 @@ AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *o
nspOid,
objsMoved);

/*
* Remember previous namespace of first object that has one
*/
if (oldNspOid == InvalidOid && dep_oldNspOid != InvalidOid)
oldNspOid = dep_oldNspOid;

/*
* If not all the objects had the same old namespace (ignoring any
* that are not in namespaces), complain.