Commit Graph

56279 Commits

Author SHA1 Message Date
Bruce Momjian e6a254c0d4 doc: PG 16 relnotes, move memory item and reword OUTER item
Reported-by: David Rowley

Discussion: https://postgr.es/m/CAApHDvqmqxcX2n9NwvsfnsN0be6DjmyLSjz3Jk2DaZO5OLW+pw@mail.gmail.com
2023-05-31 07:01:21 -04:00
Bruce Momjian 409d24485c doc: PG 16 relnotes, add memory overhead reduction item
Reported-by: David Rowley

Discussion: https://postgr.es/m/CAApHDvqnUoyrJxS4uqnKo87b3_cUjaDDte4NQag49YHu1oEOgA@mail.gmail.com
2023-05-30 19:32:15 -04:00
Bruce Momjian f7c16a120c doc: PG 16 relnotes, adjust subscription origin mention
Reported-by: Masahiko Sawada

Discussion: https://postgr.es/m/CAD21AoC+VihMWs3-xVB3Z=8LzLbsQc52TO29o25rzfqcnJDCUQ@mail.gmail.com
2023-05-30 19:08:14 -04:00
Bruce Momjian 0bcb3ca3b9 doc: PG 16 relnotes, adjust auto_explain logging item
Reported-by: Dagfinn Ilmari Mannsåker

Discussion: https://postgr.es/m/878rdctb7o.fsf@wibble.ilmari.org
2023-05-30 06:04:09 -04:00
Daniel Gustafsson e77c6c55e8 doc: Add missing backend_type to pg_stat_activity
Commit 0c679464a8 added the missing backendDesc for B_STANDALONE_BACKEND
but missed updating the list of backend types in the documentation.  Fix
by adding it to the list.

Author: Noriyoshi Shinoda <noriyoshi.shinoda@hpe.com>
Discussion: https://postgr.es/m/DM4PR84MB1734ECEA02BCB59564E8FC03EE4A9@DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM
2023-05-30 10:31:11 +02:00
Bruce Momjian 5a64640966 doc: PG 16 relnotes: adjust outer/full hash join parallelization
Reported-by: David Rowley

Discussion: https://postgr.es/m/CAApHDvph4djrP+zjOK67VcgbB_p9Zn8QoO7Qctt4oQgUC_ejEw@mail.gmail.com
2023-05-29 14:36:27 -04:00
Bruce Momjian 9e28b83ae6 doc: PG 16 relnotes, fix duplicate author and commit
Reported-by: Masahiko Sawada

Discussion: https://postgr.es/m/CAD21AoALE_joh=H-j5sdaAfDs=BXtCy6BQKYZBTi=neU8k0VFw@mail.gmail.com
2023-05-29 13:49:05 -04:00
Bruce Momjian 503b0556d9 doc: PG 16 relnotes, fix "locale" typo and windows locale text
Reported-by: Laurenz Albe, Álvaro Herrera

Discussion: https://postgr.es/m/70a09a9fa557b632f4b1505395aaa6c4cb77b55a.camel@cybertec.at
2023-05-27 23:04:48 -04:00
Jeff Davis ec1264f01e ICU: use uloc_getDefault() for initdb.
Simpler, and better preserves the locale name as read from the
environment.

Author: Daniel Verite
Discussion: https://postgr.es/m/a6204a46-c077-451b-8f9d-8965d95bb57c@manitou-mail.org
2023-05-26 11:26:11 -07:00
Tom Lane 7a844c77ec Fix joinclause removal logic to cope with cloned clauses.
When we're deleting a no-op LEFT JOIN from the query, we must remove
the join's joinclauses from surviving relations' joininfo lists.
The invention of "cloned" clauses in 2489d76c4 broke the logic for
that; it'd fail to remove clones that include OJ relids outside the
doomed join's min relid sets, which could happen if that join was
previously discovered to commute with some other join.

This accidentally failed to cause problems in the majority of cases,
because we'd never decide that such a cloned clause was evaluatable at
any surviving join.  However, Richard Guo discovered a case where that
did happen, leading to "no relation entry for relid" errors later.
Also, adding assertions that a non-removed clause contains no Vars from
the doomed join exposes that there are quite a few existing regression
test cases where the problem happens but is accidentally not exposed.

The fix for this is just to include the target join's commute_above_r
and commute_below_l sets in the relid set we test against when
deciding whether a join clause is "pushed down" and thus not
removable.

While at it, do a little refactoring: the join's relid set can be
computed inside remove_rel_from_query rather than in the caller.

Patch by me; thanks to Richard Guo for review.

Discussion: https://postgr.es/m/CAMbWs4_PHrRqTKDNnTRsxxQy6BtYCVKsgXm1_gdN2yQ=kmcO5g@mail.gmail.com
2023-05-26 12:13:19 -04:00
Jeff Davis f4a9422c0c Doc fixes for commit 1e16af8ab5.
Discussion: https://postgr.es/m/275c47ea-e7f3-e654-c99a-63bc116997d7@enterprisedb.com
2023-05-25 17:05:50 -07:00
Peter Geoghegan 5abff197cc nbtree VACUUM: cope with right sibling link corruption.
Avoid "right sibling's left-link doesn't match" errors when vacuuming a
corrupt nbtree index.  Just LOG the issue and press on.  That way VACUUM
will have a decent chance of finishing off all required processing for
the index (and for the table as a whole).

This error was seen in the field from time to time (it's more than a
theoretical risk), so giving VACUUM the ability to press on like this
has real value.  Nothing short of a REINDEX is expected to fix the
underlying index corruption, so giving up (by throwing an error) risks
making a bad situation far worse.  Anything that blocks forward progress
by VACUUM like this might go unnoticed for a long time.  This could
eventually lead to a wraparound/xidStopLimit outage.

Note that _bt_unlink_halfdead_page() has always been able to bail on
page deletion when the target page's left sibling page was in an
inconsistent state.  It now does the same thing (returns false to back
out of the second phase of deletion) when it notices sibling link
corruption in the target page's right sibling page.

This is similar to the work from commit 5b861baa (later backpatched as
commit 43e409ce), which taught nbtree to press on with vacuuming an
index when page deletion fails to "re-find" a downlink in the target
page's parent page.  The "re-find" check seems to make VACUUM bail on
page deletion more often in practice, but there is no reason to take any
chances here.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CAH2-Wzko2q2kP1+UvgJyP9g0mF4hopK0NtQZcxwvMv9_ytGhkQ@mail.gmail.com
Backpatch: 11- (all supported versions).
2023-05-25 15:33:00 -07:00
Tom Lane 991a3df227 Fix filtering of "cloned" outer-join quals some more.
We've had multiple issues with the clause_is_computable_at logic that
I introduced in 2489d76c4: it's been known to accept more than one
clone of the same qual at the same plan node, and also to accept no
clones at all.  It's looking impractical to get it 100% right on the
basis of the currently-stored information, so fix it by introducing a
new RestrictInfo field "incompatible_relids" that explicitly shows
which outer joins a given clone mustn't be pushed above.

In principle we could populate this field in every RestrictInfo, but
that would cost space and there doesn't presently seem to be a need
for it in general.  Also, while deconstruct_distribute_oj_quals can
easily fill the field with the remaining members of the commutative
join set that it's considering, computing it in the general case
seems again pretty complicated.  So for now, just fill it for
clone quals.

Along the way, fix a bug that may or may not be only latent:
equivclass.c was generating replacement clauses with is_pushed_down
and has_clone/is_clone markings that didn't match their
required_relids.  This led me to conclude that leaving the clone flags
out of make_restrictinfo's purview wasn't such a great idea after all,
so add them.

Per report from Richard Guo.

Discussion: https://postgr.es/m/CAMbWs48EYi_9-pSd0ORes1kTmTeAjT4Q3gu49hJtYCbSn2JyeA@mail.gmail.com
2023-05-25 10:28:33 -04:00
Daniel Gustafsson 913b3da6ae doc: fix typo in language tag documentation
Commit 1e16af8ab5 accidentally mistyped 'language' in one place.
2023-05-25 12:49:26 +02:00
Daniel Gustafsson 661bf96cd2 doc: Fix example query for pg_walinspect
The LIMIT clause had ended up in the wrong place in the query.
Backpatch to v15 where pg_walinspect was introduced.

Reported-by: Jian He <jian.universality@gmail.com>
Discussion: https://postgr.es/m/CACJufxHqXDr4NnmwmR6pEiVPAg54J0dgwMuYQzrH5BX6+NtF1g@mail.gmail.com
Backpatch-through: 15
2023-05-25 12:43:16 +02:00
Alvaro Herrera 8f5e42d334
Fix pgbench in prepared mode with an empty pipeline
It crashes because it references memory that's not allocated in that
particular case.  Fix by allocating it.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/bcf802a6-afc1-95b9-7bf4-c5dd868ec144@gmail.com
2023-05-25 12:36:18 +02:00
Michael Paquier ecb968e7e3 Fix typo in TAP tests of vacuumdb
Noticed while scanning the area, introduced in 582edc3.
2023-05-25 16:26:08 +09:00
Bruce Momjian 46ba86cd32 doc: PG 16 relnotes, add author from previous merge
Reported-by: John Naylor

Discussion: https://postgr.es/m/CAFBsxsEMoNdg6CCMuQ-6YJ8G=AgGNMVuiTb5Di5bsoPfBb=9CA@mail.gmail.com
2023-05-24 22:03:40 -04:00
Bruce Momjian 5c2c59ba0b doc: PG 16 relnotes, wording adjustments
Reported-by: Erik Rijkers

Discussion: https://postgr.es/m/c4a88acf-ab1a-a912-d4a9-5e19b323c5ed@xs4all.nl
2023-05-24 12:18:43 -04:00
Bruce Momjian ad5406246b doc: PG 16 relnotes, merge and move vector items
Reported-by: John Naylor

Discussion: https://postgr.es/m/CAFBsxsEPg8L2MmGqavc8JByC=WF_Mnkhn-KKnFPkcqh0hydung@mail.gmail.com
2023-05-24 09:54:34 -04:00
Bruce Momjian a817edbf6f doc: PG 16 relnotes, update xid/subxid searches item
Reported-by: John Naylor

Discussion: https://postgr.es/m/CAFBsxsEPg8L2MmGqavc8JByC=WF_Mnkhn-KKnFPkcqh0hydung@mail.gmail.com
2023-05-24 00:09:13 -04:00
Nathan Bossart 381d19b3ea Document deprecated createuser option.
2dcd1578c4 left the --role option undocumented, which is
inconsistent with other deprecated options such as pg_dump's
--blobs and --no-blobs.  This change adds --role back to
createuser's documentation and usage output and marks it as
deprecated.

Suggested-by: Peter Eisentraut
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/0e85c9e7-4804-1cdb-5a4a-c72c328f9ad8%40enterprisedb.com
2023-05-23 19:35:05 -07:00
Tom Lane be3f62ae6e Doc: update src/tools/pginclude/README.
Commit f62975b2a made headerscheck and cpluspluscheck a little
smarter than this documentation gave them credit for.  Make
their docs match current reality.  Also add a warning about the
layer of dust that has settled on the rest of these scripts.

Discussion: https://postgr.es/m/769950.1684797558@sss.pgh.pa.us
2023-05-23 18:51:43 -04:00
Tom Lane 5df5bea290 Fix the install rule for snowball_create.sql.
This file could be in the current (build) directory if we just
built it.  However, when installing from a VPATH build from a
tarball, it will exist in the source directory and gmake will
therefore not rebuild it.  Use the $< macro to find out where
gmake found it.

Oversight in b3a0d8324, which also exposes a buildfarm testing gap:
we test install from VPATH builds from bare source trees, but not
from tarballs.

Per report from Christoph Berg.

Discussion: https://postgr.es/m/ZGzEAqjxkkoY3ooH@msg.df7cb.de
2023-05-23 11:15:57 -04:00
Peter Eisentraut 0ffbe6e591 Use lower case for icu_validation_level values
Similar to client_min_messages etc.
2023-05-23 15:19:33 +02:00
Peter Eisentraut dfe0169988 Punctuation improvement in postgresql.conf.sample 2023-05-23 15:19:12 +02:00
Peter Eisentraut f40177c904 Add newline at end of file 2023-05-23 15:18:06 +02:00
Bruce Momjian 5cb54fc310 doc: PG 16 relnotes, SIMD improvements
Reported-by: John Naylor

Discussion: https://postgr.es/m/CAFBsxsEuAx4_nq=200u=70S5r83C2hzO-a9+c6YXTCbOFeDAfw@mail.gmail.com
2023-05-23 00:27:01 -04:00
Tom Lane e0b82fc8e8 Stamp 16beta1. 2023-05-22 17:08:08 -04:00
Bruce Momjian 60751aa503 doc: PG 16 relnotes, add major features list
Reported-by: Jonathan Katz

Discussion: https://postgr.es/m/2fd2cc0e-df39-3e77-8fcf-35aad5796b0a@postgresql.org
2023-05-22 13:58:24 -04:00
Tom Lane 1f9f6aa491 Spell the values of libpq's gssdelegation parameter as "0" and "1".
That's how other boolean options are handled, so do likewise.
The previous coding with "enable" and "disable" was seemingly
modeled on gssencmode, but that's a three-way flag.

While at it, add PGGSSDELEGATION to the set of environment
variables cleared by pg_regress and Utils.pm.

Abhijit Menon-Sen, per gripe from Alvaro Herrera

Discussion: https://postgr.es/m/20230522091609.nlyuu4nolhycqs2p@alvherre.pgsql
2023-05-22 11:50:27 -04:00
Bruce Momjian 4123455a9e doc: PG 16 relnotes, improve desc. of pg_log_standby_snapshot() 2023-05-22 10:21:20 -04:00
Peter Eisentraut 473e02f6f9 Translation updates
Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git
Source-Git-Hash: 642d41265b1ea68ae71a66ade5c5440ba366a890
2023-05-22 12:44:31 +02:00
Alvaro Herrera 4042b2e187
pg_dump doc: mention 'long' is valid for --compress
Apparently an oversight in 2820adf775.
2023-05-22 12:26:40 +02:00
Bruce Momjian ac298d3cb5 doc: PG 16 relnotes, improve description of standby log. decode
Improve description of "Allow logical decoding on standbys".
2023-05-21 23:39:50 -04:00
Nathan Bossart 2dcd1578c4 Rename some createuser options.
This change renames --admin to --with-admin, --role to --member-of,
and --member to --with-member.  Many people found the previous
names to be confusing.  The --admin and --member options are new in
v16, but --role has been there for a while, so that one has been
kept (but left undocumented) for backward compatibility.

Suggested-by: Peter Eisentraut
Reviewed-by: Tom Lane, Michael Paquier
Discussion: https://postgr.es/m/ZFvVZvQDliIWmOwg%40momjian.us
2023-05-21 20:06:38 -07:00
Bruce Momjian de7c3fd34e doc: PG 16 relnotes, misc merged items and bootstrap detail
Reported-by: Andres Freund, jian he

Discussion: https://postgr.es/m/20230521171341.jjxykfsefsek4kzj@awork3.anarazel.de, 20230521171341.jjxykfsefsek4kzj@awork3.anarazel.de
2023-05-21 22:52:42 -04:00
Bruce Momjian c822358a25 doc: PG 16 relnotes, misc. updates
Reported-by: Tom Lane

Discussion: https://postgr.es/m/277016.1684689065@sss.pgh.pa.us
2023-05-21 15:57:59 -04:00
Tom Lane b9c755a2f6 In clause_is_computable_at(), test required_relids for clone clauses.
Use the clause's required_relids not clause_relids for testing
whether it is computable at the current join level, if it is a
clone clause generated by deconstruct_distribute_oj_quals().

Arguably, this is more correct and we should do it for all clauses;
that would at least remove the handwavy claim that we are doing
it to save cycles compared to inspecting Vars individually.
However, attempting to do that exposes that we are not being careful
to compute an accurate value for required_relids in all cases.
I'm unsure whether it's a good idea to attempt to do that for v16,
or leave it as future clean-up.  In the meantime, this quick hack
demonstrably fixes some cases, so let's squeeze it in for beta1.

Patch by me, but great thanks to Richard Guo for investigation
and testing.  The new test cases are all modeled on his examples.

Discussion: https://postgr.es/m/CAMbWs4-_vwkBij4XOQ5ukxUvLgwTm0kS5_DO9CicUeKbEfKjUw@mail.gmail.com
2023-05-21 15:25:52 -04:00
Andres Freund eabb22525e Remove over-eager assertion in ExtendBufferedRelTo()
The assertion checked that the size of the relation is not "too large" - but
the code is explicitly dealing with the possibility of another backend
extending the relation concurrently. In that case the new relation size could
be bigger than what the current backend needs, wrongly triggering an assertion
failure.

Unfortunately it is hard to write a reliable and affordable regression tests
for this, as a lot of concurrency is needed to encounter the bug.

Introduced in 31966b151e.

Reported-by: Melanie Plageman <melanieplageman@gmail.com>
2023-05-21 09:53:49 -07:00
Andres Freund bc971f4025 Optimize walsender wake up logic using condition variables
WalSndWakeup() currently loops through all the walsenders slots, with a
spinlock acquisition and release for every iteration, to wake up waiting
walsenders.

This commonly was not a problem before e101dfac3a. But, to allow logical
decoding on standbys, we need to wake up logical walsenders after every WAL
record is applied on the standby, rather just when flushing WAL or switching
timelines.  This causes a performance regression for workloads replaying a lot
of WAL records.

To solve this, we use condition variable (CV) to efficiently wake up
walsenders in WalSndWakeup().

Every walsender prepares to sleep on a shared memory CV. Note that it just
prepares to sleep on the CV (i.e., adds itself to the CV's waitlist), but does
not actually wait on the CV (IOW, it never calls ConditionVariableSleep()). It
still uses WaitEventSetWait() for waiting, because CV infrastructure doesn't
handle FeBe socket events currently. The processes (startup process,
walreceiver etc.)  wanting to wake up walsenders use
ConditionVariableBroadcast(), which in turn calls SetLatch(), helping
walsenders come out of WaitEventSetWait().

We use separate shared memory CVs for physical and logical walsenders for
selective wake ups, see WalSndWakeup() for more details.

This approach is simple and reasonably efficient. But not very elegant. But
for 16 it seems to be a better path than a larger redesign of the CV
mechanism.  A desirable future improvement would be to add support for CVs
into WaitEventSetWait().

This still leaves us with a small regression in very extreme workloads (due to
the spinlock acquisition in ConditionVariableBroadcast() when there are no
waiters) - but that seems acceptable.

Reported-by: Andres Freund <andres@anarazel.de>
Suggested-by: Andres Freund <andres@anarazel.de>
Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>
Reviewed-by: Zhijie Hou <houzj.fnst@fujitsu.com>
Discussion: https://www.postgresql.org/message-id/20230509190247.3rrplhdgem6su6cg%40awork3.anarazel.de
2023-05-21 09:44:55 -07:00
Bruce Momjian 30579d23b2 doc: PG 16 relnotes, add commits
Reported-by: Ian Lawrence Barwick

Discussion: https://postgr.es/m/CAB8KJ=hLvQDb53WdigV7OBEBh5tzQ7eA=pG0ZpccoRVBUNCXYA@mail.gmail.com
2023-05-21 11:56:16 -04:00
Tom Lane b62381d9a2 Doc: fix some rendering problems in the PDF docs build.
Tweak column widths in a couple of tables to avoid "contents
... exceed the available area" warnings.  Remove usage of
some non-Latin-1 characters.

Discussion: https://postgr.es/m/614600.1684537037@sss.pgh.pa.us
2023-05-21 11:21:19 -04:00
Tom Lane a2eb99a01e Expand some more uses of "deleg" to "delegation" or "delegated".
Complete the task begun in 9c0a0e2ed: we don't want to use the
abbreviation "deleg" for GSS delegation in any user-visible places.
(For consistency, this also changes most internal uses too.)

Abhijit Menon-Sen and Tom Lane

Discussion: https://postgr.es/m/949048.1684639317@sss.pgh.pa.us
2023-05-21 10:55:18 -04:00
Nathan Bossart f4001a5537 Fix remaining references to gss_accept_deleg.
These were missed in 9c0a0e2ed9.

Discussion: https://postgr.es/m/20230521031757.GA3835667%40nathanxps13
2023-05-20 20:32:56 -07:00
Bruce Momjian 9c0a0e2ed9 rename "gss_accept_deleg" to "gss_accept_delegation".
This is more consistent with existing GUC spelling.

Discussion: https://postgr.es/m/ZGdnEsGtNj7+fZoa@momjian.us
2023-05-20 21:32:54 -04:00
Bruce Momjian cf109ffc20 doc: PG 16 relnotes, misc updates
*  document to_reg* accepting OIDs
*  document pg_log_standby_snapshot()
*  document pg_input_is_valid() and pg_input_error_info()
*  handle rename of function to pg_split_walfile_name()
*  fix character encoding problem for Przemyslaw Sztoch
*  remove partition section

Reported-by: jian he, Tom Lane, Bertrand Drouvot
2023-05-20 21:03:13 -04:00
Tom Lane 1c006c0671 Add 0245f8db3 to .git-blame-ignore-revs. 2023-05-19 17:28:04 -04:00
Tom Lane 0245f8db36 Pre-beta mechanical code beautification.
Run pgindent, pgperltidy, and reformat-dat-files.

This set of diffs is a bit larger than typical.  We've updated to
pg_bsd_indent 2.1.2, which properly indents variable declarations that
have multi-line initialization expressions (the continuation lines are
now indented one tab stop).  We've also updated to perltidy version
20230309 and changed some of its settings, which reduces its desire to
add whitespace to lines to make assignments etc. line up.  Going
forward, that should make for fewer random-seeming changes to existing
code.

Discussion: https://postgr.es/m/20230428092545.qfb3y5wcu4cm75ur@alvherre.pgsql
2023-05-19 17:24:48 -04:00
Tom Lane df6b19fbbc Make agreed-on updates in perltidy options.
Our standard version of perltidy is now 20230309.
Add a --valign-exclusion-list setting to reduce crosstalk
between nearby lines of Perl code.

Also, update instructions for running pgindent
(missed in b16259b3c).

Discussion: https://postgr.es/m/20230428092545.qfb3y5wcu4cm75ur@alvherre.pgsql
2023-05-19 16:43:57 -04:00