git.postgresql.org Git - postgresql.git/rss log
http://git.postgresql.org/gitweb/?p=postgresql.git;a=summary
This is the main PostgreSQL git repository.enMagnus Hagander/static/git-logo.pnggit.postgresql.org Git - postgresql.git/rss log
http://git.postgresql.org/gitweb/?p=postgresql.git;a=summary
Mon, 28 Apr 2025 00:08:15 +0000Mon, 28 Apr 2025 00:08:15 +0000gitweb v.2.29.2/2.30.2Remove circular #include's between wait_event.h and wait_event_types.hMichael Paquier <michael@paquier.xyz>Mon, 28 Apr 2025 00:08:15 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=b225c5e76ed1053e505e392423b0dab065a3b813
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=b225c5e76ed1053e505e392423b0dab065a3b813
Remove circular #include's between wait_event.h and wait_event_types.h
Remove circular #include's between wait_event.h and wait_event_types.h
wait_event_types.h is generated by the code, and included wait_event.h.
wait_event.h did the opposite move, including wait_event_types.h,
causing a circular dependency between both.
wait_event_types.h only needs to now about the wait event classes, so
this information is moved into its own file, and wait_event_types.h uses
this new header so as it does not depend anymore on wait_event.h.
Note that such errors can be found with clang-tidy, with commands like
this one:
clang-tidy source_file.c --checks=misc-header-include-cycle -- \
-I/install/path/include/ -I/install/path/include/server/
Issue introduced by fa88928470b5.
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/350192.1745768770@sss.pgh.pa.us
]]>
Disallow removing placeholders during Self-Join Elimination.Alexander Korotkov <akorotkov@postgresql.org>Sun, 27 Apr 2025 22:40:42 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=1aa7cf9eb85972aaf2969306e84f5fc794fbef7f
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=1aa7cf9eb85972aaf2969306e84f5fc794fbef7f
Disallow removing placeholders during Self-Join Elimination.
Disallow removing placeholders during Self-Join Elimination.
fc069a3a6319 implements Self-Join Elimination (SJE), which can remove base
relations when appropriate. However, regressions tests for SJE only cover
the case when placeholder variables (PHVs) are evaluated and needed only
in a single base rel. If this baserel is removed due to SJE, its clauses,
including PHVs, will be transferred to the keeping relation. Removing these
PHVs may trigger an error on plan creation -- thanks to the b3ff6c742f6c for
detecting that.
This commit skips removal of PHVs during SJE. This might also happen that
we skip the removal of some PHVs that could be removed. However, the overhead
of extra PHVs is small compared to the complexity of analysis needed to remove
them.
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Alena Rybakina <a.rybakina@postgrespro.ru>
Author: Andrei Lepikhov <lepihov@gmail.com>
Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
Reviewed-by: Richard Guo <guofenglinux@gmail.com>
]]>
Remove inappropriate inclusions of c.h and postgres_fe.h.Tom Lane <tgl@sss.pgh.pa.us>Sun, 27 Apr 2025 20:58:57 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=2f5b05620330baed1648a1a6e2f231c7ba1368d1
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=2f5b05620330baed1648a1a6e2f231c7ba1368d1
Remove inappropriate inclusions of c.h and postgres_fe.h.
Remove inappropriate inclusions of c.h and postgres_fe.h.
Per our usual policy, Postgres header files should not include these;
the decision as to which one to use is to be made in the calling .c
file instead.
These errors aren't particularly new, but I'm not feeling a need
to back-patch these changes; it's mostly just neatnik-ism.
]]>
Don't use double-quotes in #include's of system headers, redux.Tom Lane <tgl@sss.pgh.pa.us>Sun, 27 Apr 2025 17:23:19 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=94b84a60729e15ee071739c3aec7fdd781123aab
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=94b84a60729e15ee071739c3aec7fdd781123aab
Don't use double-quotes in #include's of system headers, redux.
Don't use double-quotes in #include's of system headers, redux.
This cleans up some loose ends left by commit e8ca9ed1d. I hadn't
looked closely enough at these places before, but now I have.
The use of double-quoted #includes for Perl headers in plperl_system.h
seems to be simply a mistake introduced in 6c944bf3c and faithfully
copied forward since then. (I had thought possibly it was required
by some weird Windows build setup, but there's no evidence of that in
our history.)
The occurrences in SectionMemoryManager.h and SectionMemoryManager.cpp
evidently stem from those files' origin as LLVM code. It's
understandable that LLVM would treat their own files as needing
double-quoted #includes; but they're still system headers to us.
I also applied the same check to *.c files, and found a few other
random incorrect usages in both directions.
Our ECPG headers and test files routinely use angle brackets to refer
to ECPG headers. I left those usages alone, since it seems reasonable
for an ECPG user to regard those headers as system headers.
]]>
Remove circular #include's between plpython.h and plpy_util.h.Tom Lane <tgl@sss.pgh.pa.us>Sun, 27 Apr 2025 15:43:02 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=2311f193ea7db23f68f5471ae2c35940fc0d4794
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=2311f193ea7db23f68f5471ae2c35940fc0d4794
Remove circular #include's between plpython.h and plpy_util.h.
Remove circular #include's between plpython.h and plpy_util.h.
plpython.h included plpy_util.h, simply on the grounds that "it's
easier to just include it everywhere". However, plpy_util.h must
include plpython.h, or it won't pass headerscheck. While the
resulting circularity doesn't have any immediate bad effect,
it's poor design. We have seen serious messes arise in the past
from overly-broad inclusion footprints created by such circularities,
so let's establish a project policy against it.
To fix, just replace *.c files' inclusions of plpython.h with
plpy_util.h. They'll pull in plpython.h indirectly; indeed, almost
all have already done so via inclusions of other plpy_xxx.h headers.
(Any extensions using plpython.h can do likewise without breaking
the compatibility of their code with prior Postgres versions.)
Reported-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/aAxQ6fcY5QQV1lo3@ip-10-97-1-34.eu-west-3.compute.internal
]]>
Don't use double-quotes in #include's of system headers.Tom Lane <tgl@sss.pgh.pa.us>Sun, 27 Apr 2025 00:30:27 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=e8ca9ed1d260e214f02f7f5464f125fe86e55597
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=e8ca9ed1d260e214f02f7f5464f125fe86e55597
Don't use double-quotes in #include's of system headers.
Don't use double-quotes in #include's of system headers.
While few if any C compilers will complain about this, it's
inconsistent with our other #include's of the same headers.
There are some other questionable usages in
src/include/jit/SectionMemoryManager.h and
src/pl/plperl/plperl_system.h, but perhaps those have a
reason to be like that. I can't see that these do.
Noticed while fooling around with a script to do analysis
of our header cross-inclusions.
]]>
Eliminate divide in new fast-path locking codeDavid Rowley <drowley@postgresql.org>Sat, 26 Apr 2025 23:53:40 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=936457419d797dfaf37191db53d5efb1279eae6d
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=936457419d797dfaf37191db53d5efb1279eae6d
Eliminate divide in new fast-path locking code
Eliminate divide in new fast-path locking code
c4d5cb71d2 adjusted the fast-path locking code to allow some
configuration of the number of fast-path locking slots via the
max_locks_per_transaction GUC. In that commit the FAST_PATH_REL_GROUP()
macro used integer division to determine the fast-path locking group slot
to use for the lock.
The divisor in this case is always a power-of-two value. Here we swap
out the divide by a bitwise-AND, which is a significantly faster
operation to perform.
In passing, adjust the code that's setting FastPathLockGroupsPerBackend
so that it's more clear that the value being set is a power-of-two.
Also, adjust some comments in the area which contained some magic
numbers. It seems better to justify the 1024 upper limit in the
location where the #define is made instead of where it is used.
Author: David Rowley <drowleyml@gmail.com>
Reviewed-by: Tomas Vondra <tomas@vondra.me>
Discussion: https://postgr.es/m/CAApHDvodr3bcnpxcs7+k-3cFwYR0tP-BYhyd2PpDhe-bCx9i=g@mail.gmail.com
]]>
Match parameter in new function to earlier equivalentsJohn Naylor <john.naylor@postgresql.org>Sat, 26 Apr 2025 20:03:52 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=27757677ca4da566ff21f65c58a008818afb5b06
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=27757677ca4da566ff21f65c58a008818afb5b06
Match parameter in new function to earlier equivalents
Match parameter in new function to earlier equivalents
Oversight in commit 3c6e8c123.
]]>
aio: Improve debug logging around waiting for IOsAndres Freund <andres@anarazel.de>Fri, 25 Apr 2025 16:31:42 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=039bfc457e436dc5c6b1d6ef996048ae19ff480d
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=039bfc457e436dc5c6b1d6ef996048ae19ff480d
aio: Improve debug logging around waiting for IOs
aio: Improve debug logging around waiting for IOs
Trying to investigate a bug report by Alexander Lakhin made it apparent that
the debug logging around waiting for IO completion is insufficient. Fix that.
Discussion: https://postgr.es/m/h4in2db37vepagmi2oz5vvqymjasc5gyb4lpqkunj4eusu274i@37jpd3c2spd3
]]>
Fix bug allowing io_combine_limit > io_max_combine_combine limitAndres Freund <andres@anarazel.de>Fri, 25 Apr 2025 16:18:27 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=500b61769fa27e9f00a03c3f544f70da3bf3d679
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=500b61769fa27e9f00a03c3f544f70da3bf3d679
Fix bug allowing io_combine_limit > io_max_combine_combine limit
Fix bug allowing io_combine_limit > io_max_combine_combine limit
10f66468475 intended to limit the value of io_combine_limit to the minimum of
io_combine_limit and io_max_combine_limit. To avoid issues with interdependent
GUCs, it introduced io_combine_limit_guc and set io_combine_limit in assign
hooks. That plan was thwarted by guc_tables.c accidentally still referencing
io_combine_limit, instead of io_combine_limit_guc. That lead to the GUC
machinery overriding the work done in the assign hooks, potentially leaving
io_combine_limit with a too high value.
The consequence of this bug was that when running with io_combine_limit >
io_combine_limit_guc the AIO machinery would not have reserved large enough
iovec and IO data arrays, with one IO's arrays overlapping with another IO's,
leading to total confusion.
To make such a problem easier to detect in the future, add assertions to
pgaio_io_set_handle_data_* checking the length is smaller than
io_max_combine_limit (not just PG_IOV_MAX).
It'd be nice to have a few tests for this, but it's not entirely obvious how
to do so portably.
As remarked upon by Tom, the GUC assignment hooks really shouldn't set the
underlying variable, that's the job of the GUC machinery. Change that as well.
Discussion: https://postgr.es/m/c5jyqnuwrpigd35qe7xdypxsisdjrdba5iw63mhcse4mzjogxo@qdjpv22z763f
]]>
aio: Fix crash potential for pg_aios views due to late state updateAndres Freund <andres@anarazel.de>Fri, 25 Apr 2025 16:03:41 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=0d9114b7040d7503096e2897f4c856b17d461f6a
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=0d9114b7040d7503096e2897f4c856b17d461f6a
aio: Fix crash potential for pg_aios views due to late state update
aio: Fix crash potential for pg_aios views due to late state update
pgaio_io_reclaim() reset the fields in PgAioHandle before updating the state
to IDLE or incrementing the generation. For most things that's OK, but for
pg_get_aios() it is not - if it copied the PgAioHandle while fields were being
reset, we wouldn't detect that and could call
pgaio_io_get_target_description() with ioh->target == PGAIO_TID_INVALID,
leading to a crash.
Fix this issue by incrementing the generation and state earlier, before
resetting.
Also add an assertion to pgaio_io_get_target_description() for the target to
be valid - that'd have made this case a bit easier to debug. While at it,
add/update a few related assertions.
Author: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/062daca9-dfad-4750-9da8-b13388301ad9@gmail.com
]]>
Fix incorrect format placeholdersPeter Eisentraut <peter@eisentraut.org>Fri, 25 Apr 2025 14:49:30 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=76d52e71659149d20d616c8a94c02793cedce066
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=76d52e71659149d20d616c8a94c02793cedce066
Fix incorrect format placeholders
Fix incorrect format placeholders
Before commit a0ed19e0a9e there was a cast around these, but the cast
inadvertently changed the signedness, but that made the format
placeholder correct. Commit a0ed19e0a9e removed the casts, so now the
format placeholders had the wrong signedness.
]]>
Fix terminology in comment and messagePeter Eisentraut <peter@eisentraut.org>Fri, 25 Apr 2025 14:26:28 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=385959bdeafb2e4c4b02adb55b78bde6eac616f7
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=385959bdeafb2e4c4b02adb55b78bde6eac616f7
Fix terminology in comment and message
Fix terminology in comment and message
Should be "bracket" not "brace" for [].
]]>
Small code consistency improvementPeter Eisentraut <peter@eisentraut.org>Fri, 25 Apr 2025 10:56:40 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=0787646e1dce966395f211fb9475dcab32daae70
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=0787646e1dce966395f211fb9475dcab32daae70
Small code consistency improvement
Small code consistency improvement
Adjust the way the increment operators are placed to be consistent
throughout the function. Fixup for commit commit c1da7281060.
]]>
Fix typo in test file name added in commit 4909b38af0.Amit Kapila <akapila@postgresql.org>Fri, 25 Apr 2025 07:16:02 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=50b8ad30f7541ff48f50a42be9d6bd59b8ce4074
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=50b8ad30f7541ff48f50a42be9d6bd59b8ce4074
Fix typo in test file name added in commit 4909b38af0.
Fix typo in test file name added in commit 4909b38af0.
Author: Shlok Kyal <shlok.kyal.oss@gmail.com>
Backpatch-through: 13
Discussion: https://postgr.es/m/CANhcyEXsObdjkjxEnq10aJumDpa5J6aiPzgTh_w4KCWRYHLw6Q@mail.gmail.com
]]>
doc: remove unnecessary secondary index terms for replication settings.Fujii Masao <fujii@postgresql.org>Fri, 25 Apr 2025 05:58:14 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=632f62dcecc78fe66f06a1ce1b0c57d16f32e191
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=632f62dcecc78fe66f06a1ce1b0c57d16f32e191
doc: remove unnecessary secondary index terms for replication settings.
doc: remove unnecessary secondary index terms for replication settings.
Previously, config.sgml included secondary index terms for
max_replication_slots and max_active_replication_origins. These are
no longer necessary, as each parameter now has a single distinct index entry.
The secondary index terms were originally useful because
max_active_replication_origins was part of max_replication_slots,
and separate index entries helped users locate each setting. However,
commit 04ff636cbce split them into independent parameters,
making the secondary terms redundant.
This commit removes the unnecessary secondary index entries to
simplify the documentation.
Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Euler Taveira <euler@eulerto.com>
Reviewed-by: Robert Treat <rob@xzilla.net>
Discussion: https://postgr.es/m/e825e7a7-4877-441d-93c1-25377db36c31@oss.nttdata.com
]]>
psql: Fix assertion failures with pipeline modeMichael Paquier <michael@paquier.xyz>Thu, 24 Apr 2025 03:22:53 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=3631612eae9c2def99151c4f36b1b3771f53cba7
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=3631612eae9c2def99151c4f36b1b3771f53cba7
psql: Fix assertion failures with pipeline mode
psql: Fix assertion failures with pipeline mode
A correct cocktail of COPY FROM, SELECT and/or DML queries and
\syncpipeline was able to break the logic in charge of discarding
results of a pipeline, done in discardAbortedPipelineResults(). Such
sequence make the backend generate a FATAL, due to a protocol
synchronization loss.
This problem comes down to the fact that we did not consider the case of
libpq returning a PGRES_FATAL_ERROR when discarding the results of an
aborted pipeline. The discarding code is changed so as this result
status is handled as a special case, with the caller of
discardAbortedPipelineResults() being responsible for consuming the
result.
A couple of tests are added to cover the problems reported, bringing an
interesting gain in coverage as there were no tests in the tree covering
the case of protocol synchronization loss.
Issue introduced by 41625ab8ea3d.
Reported-by: Alexander Kozhemyakin <a.kozhemyakin@postgrespro.ru>
Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/ebf6ce77-b180-4d6b-8eab-71f641499ddf@postgrespro.ru
]]>
Add sanity check for dshash entries when reading pgstats fileMichael Paquier <michael@paquier.xyz>Thu, 24 Apr 2025 00:20:01 +0000http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=923ae50cf55986efb5f3feb0f15253a69a5e224c
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=923ae50cf55986efb5f3feb0f15253a69a5e224c
Add sanity check for dshash entries when reading pgstats file
Add sanity check for dshash entries when reading pgstats file
Not having this check would produce a core dump at startup when running
pgstat_read_statsfile(), in the case where the information of a stats
kind for an entry in the dshash could not be found. The same check
already happens for fixed-numbered stats and entries that are stored
with their names. This issue can be seen with custom stats kinds.
Note that this problem can be reproduced what what is in the core code:
- Tweak the test module injection_points to not load the fixed-numbered
stats part, leaving only the variable-numbered stats.
- Create an instance with injection_points defined in
shared_preload_libraries.
- Create a pgstats entry by attaching and running a point.
- Restart the server without shared_preload_libraries. The startup
process detects that something is wrong and reports a WARNING.
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/aAieZAvM+K1d89R2@ip-10-97-1-34.eu-west-3.compute.internal