Bruce Momjian [Fri, 15 May 2020 12:29:57 +0000 (08:29 -0400)]
doc: PG 13 relnotes: fix xref link and remove extra word
Amit Kapila [Fri, 15 May 2020 02:40:00 +0000 (08:10 +0530)]
Make COPY TO keep locks until the transaction end.
COPY TO released the ACCESS SHARE lock immediately when it was done rather
than holding on to it until the end of the transaction.
This breaks the case where a REPEATABLE READ transaction could see an
empty table if it repeats a COPY statement and somebody truncated the
table in the meantime.
Before
4dded12faad the lock was also released after COPY FROM, but the
commit failed to notice the irregularity in COPY TO.
This is old behavior but doesn't seem important enough to backpatch.
Author: Laurenz Albe, based on suggestion by Robert Haas and Tom Lane
Reviewed-by: Amit Kapila
Discussion: https://postgr.es/m/
7bcfc39d4176faf85ab317d0c26786953646a411[email protected]
Bruce Momjian [Fri, 15 May 2020 02:36:21 +0000 (22:36 -0400)]
docs: PG 13 relnotes: add links and SGML formatting
Michael Paquier [Thu, 14 May 2020 23:19:30 +0000 (08:19 +0900)]
Remove duplicated comment block in event_trigger.c
The reasons why event triggers are disabled in standalone mode are
documented in the code path of ddl_command_start, and other places
checking if standalone mode is enabled or not mention to refer to the
comment for ddl_command_start, except for table_rewrite that duplicated
the same explanation.
Reported-by: David G. Johnston
Discussion: https://postgr.es/m/CAKFQuwYqHtXpvr2mBJRwH9f+Y5y1GXw3rhbaAu0Dk2MoNevsmA@mail.gmail.com
Tom Lane [Thu, 14 May 2020 22:44:18 +0000 (18:44 -0400)]
Doc: hack on table 26.1 till it fits in PDF format.
I abbreviated the heck out of the column headings, and made a few
small wording changes, to get it to build warning-free. I can't
say that the result is pretty, but it's probably better than
removing this table entirely.
As of this commit, we have zero "exceed the available area" warnings
in a US-letter PDF build, and one such warning (about an 863-millipoint
overrun) in an A4 build. I expect to get rid of that one by renaming
wait events, so I'm not doing anything about it at the formatting
level.
Discussion: https://postgr.es/m/6916.
1589146280@sss.pgh.pa.us
Tom Lane [Thu, 14 May 2020 22:13:08 +0000 (18:13 -0400)]
Doc: tweak examples to silence line-too-long PDF build warnings.
In one or two places it seemed reasonable to modify the example so as
to shorten its output slightly; but for the most part I just added a
&zwsp; after 67 characters, which is the most we can fit on a line
of monospace text in A4 format.
Discussion: https://postgr.es/m/6916.
1589146280@sss.pgh.pa.us
Tom Lane [Thu, 14 May 2020 17:06:38 +0000 (13:06 -0400)]
Initial pgindent and pgperltidy run for v13.
Includes some manual cleanup of places that pgindent messed up,
most of which weren't per project style anyway.
Notably, it seems some people didn't absorb the style rules of
commit
c9d297751, because there were a bunch of new occurrences
of function calls with a newline just after the left paren, all
with faulty expectations about how the rest of the call would get
indented.
Bruce Momjian [Thu, 14 May 2020 15:51:09 +0000 (11:51 -0400)]
doc: PG 13 relnotes: move docbook version change to doc sect.
Tom Lane [Thu, 14 May 2020 15:10:31 +0000 (11:10 -0400)]
Collect built-in LWLock tranche names statically, not dynamically.
There is little point in using the LWLockRegisterTranche mechanism for
built-in tranche names. It wastes cycles, it creates opportunities for
bugs (since failing to register a tranche name is a very hard-to-detect
problem), and the lack of any centralized list of names encourages
sloppy nonconformity in name choices. Moreover, since we have a
centralized list of the tranches anyway in enum BuiltinTrancheIds, we're
certainly not buying any flexibility in return for these disadvantages.
Hence, nuke all the backend-internal LWLockRegisterTranche calls,
and instead provide a const array of the builtin tranche names.
(I have in mind to change a bunch of these names shortly, but this
patch is just about getting them into one place.)
Discussion: https://postgr.es/m/9056.
1589419765@sss.pgh.pa.us
Michael Paquier [Thu, 14 May 2020 11:14:58 +0000 (20:14 +0900)]
Doc: Fix some inconsistencies with markups
This addresses some whitespace issues with programlisting, and corrects
the spelling of "Enter PEM pass phrase" to be consistent with the code.
Author: Daniel Gustafsson
Discussion: https://postgr.es/m/
401F9024-20EA-4239-83C4-
6B7AD35F94BD@yesql.se
Heikki Linnakangas [Thu, 14 May 2020 10:53:16 +0000 (13:53 +0300)]
Fix typo in comment on OpenSSL PEM password callback type name.
The type is called "pem_password_cb", not "pem_passwd_cb".
Author: Daniel Gustafsson
Discussion: https://www.postgresql.org/message-id/
22108CF6-228B-45CF-9CDA-
5C5F658DCC22@yesql.se
Alexander Korotkov [Thu, 14 May 2020 09:44:44 +0000 (12:44 +0300)]
Fix amcheck for page checks concurrent to replay of btree page deletion
amcheck expects at least hikey to always exist on leaf page even if it is
deleted page. But replica reinitializes page during replay of page deletion,
causing deleted page to have no items. Thus, replay of page deletion can
cause an error in concurrent amcheck run.
This commit relaxes amcheck expectation making it tolerate deleted page with
no items.
Reported-by: Konstantin Knizhnik
Discussion: https://postgr.es/m/CAPpHfdt_OTyQpXaPJcWzV2N-LNeNJseNB-K_A66qG%3DL518VTFw%40mail.gmail.com
Author: Alexander Korotkov
Reviewed-by: Peter Geoghegan
Backpatch-through: 11
Heikki Linnakangas [Thu, 14 May 2020 05:39:26 +0000 (08:39 +0300)]
Move check for fsync=off so that pendingOps still gets cleared.
Commit
3eb77eba5a moved the loop and refactored it, and inadvertently
changed the effect of fsync=off so that it also skipped removing entries
from the pendingOps table. That was not intentional, and leads to an
assertion failure if you turn fsync on while the server is running and
reload the config.
Backpatch-through: 12-
Reviewed-By: Thomas Munro
Discussion: https://www.postgresql.org/message-id/
3cbc7f4b-a5fa-56e9-9591-
c886deb07513%40iki.fi
Amit Kapila [Thu, 14 May 2020 03:53:56 +0000 (09:23 +0530)]
Fix the MSVC build for versions 2015 and later.
Visual Studio 2015 and later versions should still be able to do the same
as Visual Studio 2012, but the declaration of locale_name is missing in
_locale_t, causing the code compilation to fail, hence this falls back
instead on to enumerating all system locales by using EnumSystemLocalesEx
to find the required locale name. If the input argument is in Unix-style
then we can get ISO Locale name directly by using GetLocaleInfoEx() with
LCType as LOCALE_SNAME.
In passing, change the documentation references of the now obsolete links.
Note that this problem occurs only with NLS enabled builds.
Author: Juan José Santamaría Flecha, Davinder Singh and Amit Kapila
Reviewed-by: Ranier Vilela and Amit Kapila
Backpatch-through: 9.5
Discussion: https://postgr.es/m/CAHzhFSFoJEWezR96um4-rg5W6m2Rj9Ud2CNZvV4NWc9tXV7aXQ@mail.gmail.com
Noah Misch [Thu, 14 May 2020 03:42:09 +0000 (20:42 -0700)]
Fix pg_recvlogical avoidance of superfluous Standby Status Update.
The defect suppressed a Standby Status Update message when bytes flushed
to disk had changed but bytes received had not changed. If
pg_recvlogical then exited with no intervening Standby Status Update,
the next pg_recvlogical repeated already-flushed records. The defect
could also cause superfluous messages, which are functionally harmless.
Back-patch to 9.5 (all supported versions).
Discussion: https://postgr.es/m/
20200502221647[email protected]
Noah Misch [Thu, 14 May 2020 03:42:09 +0000 (20:42 -0700)]
In successful pg_recvlogical, end PGRES_COPY_OUT cleanly.
pg_recvlogical merely called PQfinish(), so the backend sent messages
after the disconnect. When that caused EPIPE in internal_flush(),
before a LogicalConfirmReceivedLocation(), the next pg_recvlogical would
repeat already-acknowledged records. Whether or not the defect causes
EPIPE, post-disconnect messages could contain an ErrorResponse that the
user should see. One properly ends PGRES_COPY_OUT by repeating
PQgetCopyData() until it returns a negative value. Augment one of the
tests to cover the case of WAL past --endpos. Back-patch to v10, where
commit
7c030783a5bd07cadffc2a1018bc33119a4c7505 first appeared. Before
that commit, pg_recvlogical never reached PGRES_COPY_OUT.
Reported by Thomas Munro.
Discussion: https://postgr.es/m/CAEepm=1MzM2Z_xNe4foGwZ1a+MO_2S9oYDq3M5D11=JDU_+0Nw@mail.gmail.com
Tom Lane [Thu, 14 May 2020 03:36:58 +0000 (23:36 -0400)]
Doc: split up wait_event table.
The previous design for this table didn't really work in narrow views,
such as PDF output; besides which its reliance on large morerows
values made it a pain to maintain (cf
ab3e4fbd5, for example).
I experimented with a couple of ways to fix it, but the best and
simplest is to split it up into a separate table for each event
type category.
I also rearranged the event ordering to be strictly alphabetical,
as nobody would ever be able to find entries otherwise.
There is work afoot to revise the set of event names described
in this table, but this commit just changes the layout, not the
contents.
In passing, add a missing entry to pg_locks.locktype,
and cross-reference that to the related wait event list.
Discussion: https://postgr.es/m/6916.
1589146280@sss.pgh.pa.us
Tom Lane [Thu, 14 May 2020 03:03:39 +0000 (23:03 -0400)]
Doc: reformat catalog/view description tables.
This changes our catalog and view descriptions to use a style inspired
by the new format for function/operator tables: each table entry is
formatted roughly like a <varlistentry>, with the column name and type
on the first line and then an indented description. This provides much
more room for expansive descriptions than we had before, and thereby
eliminates a passel of PDF build warnings.
Discussion: https://postgr.es/m/12984.
1588643549@sss.pgh.pa.us
Tom Lane [Thu, 14 May 2020 02:48:09 +0000 (22:48 -0400)]
Fix async.c to not register any SLRU stats counts in the post
Previously, AsyncShmemInit forcibly initialized the first page of the
async SLRU, to save dealing with that case in asyncQueueAddEntries.
But this is a poor tradeoff, since many installations do not ever use
NOTIFY; for them, expending those cycles in AsyncShmemInit is a
complete waste. Besides, this only saves a couple of instructions
in asyncQueueAddEntries, which hardly seems likely to be measurable.
The real reason to change this now, though, is that now that we track
SLRU access stats, the existing code is causing the postmaster to
accumulate some access counts, which then get inherited into child
processes by fork(), messing up the statistics. Delaying the
initialization into the first child that does a NOTIFY fixes that.
Hence, we can revert
f3d23d83e, which was an incorrect attempt at
fixing that issue. Also, add an Assert to pgstat.c that should
catch any future errors of the same sort.
Discussion: https://postgr.es/m/8367.
1589391884@sss.pgh.pa.us
Bruce Momjian [Thu, 14 May 2020 02:48:11 +0000 (22:48 -0400)]
doc: PG 13 relnotes: adjust wal_skip_threshold wording
Alvaro Herrera [Wed, 13 May 2020 19:31:14 +0000 (15:31 -0400)]
Dial back -Wimplicit-fallthrough to level 3
The additional pain from level 4 is excessive for the gain.
Also revert all the source annotation changes to their original
wordings, to avoid back-patching pain.
Discussion: https://postgr.es/m/31166.
1589378554@sss.pgh.pa.us
Tom Lane [Wed, 13 May 2020 17:08:12 +0000 (13:08 -0400)]
Improve management of SLRU statistics collection.
Instead of re-identifying which statistics bucket to use for a given
SLRU on every counter increment, do it once during shmem initialization.
This saves a fair number of cycles, and there's no real cost because
we could not have a bucket assignment that varies over time or across
backends anyway.
Also, get rid of the ill-considered decision to let pgstat.c pry
directly into SLRU's shared state; it's cleaner just to have slru.c
pass the stats bucket number.
In consequence of these changes, there's no longer any need to store
an SLRU's LWLock tranche info in shared memory, so get rid of that,
making this a net reduction in shmem consumption. (That partly
reverts
fe702a7b3.)
This is basically code review for
28cac71bd, so I also cleaned up
some comments, removed a dangling extern declaration, fixed some
things that should be static and/or const, etc.
Discussion: https://postgr.es/m/3618.
1589313035@sss.pgh.pa.us
Alvaro Herrera [Wed, 13 May 2020 16:17:08 +0000 (12:17 -0400)]
Adjust walsender usage of xlogreader, simplify APIs
* Have both physical and logical walsender share a 'xlogreader' state
struct for tracking state. This replaces the existing globals sendSeg
and sendCxt.
* Change WALRead not to receive XLogReaderState->seg and ->segcxt as
separate arguments anymore; just use the ones from 'state'. This is
made possible by the above change.
* have the XLogReader segment_open contract require the callbacks to
install the file descriptor in the state struct themselves instead of
returning it. xlogreader was already ignoring any possible failed
return from the callbacks, relying solely on them never returning.
(This point is not altogether excellent, as it means the callbacks
have to know more of XLogReaderState; but to really improve on that
we would have to pass back error info from the callbacks to
xlogreader. And the complexity would not be saved but instead just
transferred to the callers of WALRead, which would have to learn how
to throw errors from the open_segment callback in addition of, as
currently, from pg_pread.)
* segment_open no longer receives the 'segcxt' as a separate argument,
since it's part of the XLogReaderState argument.
Per comments from Kyotaro Horiguchi.
Author: Álvaro Herrera <
[email protected]>
Discussion: https://postgr.es/m/
20200511203336[email protected]
Fujii Masao [Wed, 13 May 2020 13:20:37 +0000 (22:20 +0900)]
Use proper GetDatum function in pg_stat_get_slru().
This commit changes pg_stat_get_slru() so that it uses
TimestampTzGetDatum() for stats_reset field because that field
stores the timestamp with time zone value. Previously
Int64GetDatum() was used.
Author: Fujii Masao
Reviewed-by: Tomas Vondra
Discussion: https://postgr.es/m/
b8784fe6-1401-ab35-aa14-
d57b5bb8e312@oss.nttdata.com
Fujii Masao [Wed, 13 May 2020 13:19:25 +0000 (22:19 +0900)]
Initialize SLRU stats entries to zero.
Previously since SLRUStats was not initialized, SLRU stats counters
could begin with non-zero value. Which could lead to incorrect results
in pg_stat_slru view.
Author: Fujii Masao
Reviewed-by: Tomas Vondra
Discussion: https://postgr.es/m/
976bbb73-a112-de3c-c488-
b34b64609793@oss.nttdata.com
Bruce Momjian [Tue, 12 May 2020 21:17:12 +0000 (17:17 -0400)]
docs: PG 13 relnotes: adjust wal_skip_threshold and UTF8 items
Alvaro Herrera [Tue, 12 May 2020 20:15:55 +0000 (16:15 -0400)]
Fix straggler
contrib/pgcrypto did contain an unedited fall-through marker after all.
Alvaro Herrera [Tue, 12 May 2020 20:01:52 +0000 (16:01 -0400)]
Add -Wimplicit-fallthrough to CFLAGS and CXXFLAGS
Use it at level 4, a bit more restrictive than the default level, and
tweak our commanding comments to FALLTHROUGH.
(However, leave zic.c alone, since it's external code; to avoid the
warnings that would appear there, change CFLAGS for that file in the
Makefile.)
Author: Julien Rouhaud <
[email protected]>
Author: Álvaro Herrera <
[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/
20200412081825.qyo5vwwco3fv4gdo@nol
Discussion: https://postgr.es/m/flat/
[email protected]
Tomas Vondra [Tue, 12 May 2020 18:04:39 +0000 (20:04 +0200)]
Rework EXPLAIN format for incremental sort
The explain format used by incremental sort was somewhat inconsistent
with other nodes, making it harder to parse and understand. This commit
addresses that by
- adding an extra space to better separate groups of values
- using colons instead of equal signs to separate key/value
- properly capitalizing first letter of a key
- using separate lines for full and pre-sorted groups
These changes were proposed by Justin Pryzby and mostly copy the final
explain format used to report WAL usage.
Author: Justin Pryzby
Reviewed-by: James Coleman
Discussion: https://postgr.es/m/
20200419023625[email protected]
Tomas Vondra [Tue, 12 May 2020 17:37:13 +0000 (19:37 +0200)]
Fix typos and improve incremental sort comments
Author: Justin Pryzby, James Coleman
Discussion: https://postgr.es/m/
20200419023625[email protected]
Tom Lane [Tue, 12 May 2020 17:03:43 +0000 (13:03 -0400)]
Do pre-release housekeeping on catalog data.
Run renumber_oids.pl to move high-numbered OIDs down, as per pre-beta
tasks specified by RELEASE_CHANGES. For reference, the command was
./renumber_oids.pl --first-mapped-oid=8000 --target-oid=5032
Also run reformat_dat_file.pl while I'm here.
Renumbering recently-added types changed some results in the opr_sanity
test. To make those a bit easier to eyeball-verify, change the queries
to show regtype not just bare type OIDs. (I think we didn't have
regtype when these queries were written.)
Etsuro Fujita [Tue, 12 May 2020 10:55:55 +0000 (19:55 +0900)]
Remove unnecessary #include.
My oversight in commit
c8434d64c.
Michael Paquier [Tue, 12 May 2020 05:43:57 +0000 (14:43 +0900)]
Fix comment in xlogutils.c
The existing callers of XLogReadDetermineTimeline() performing recovery
need to check a replay LSN position when determining on which timeline
to read a WAL page. A portion of the comment describing this function
said exactly that, while referring to a routine for fetching a write
LSN, something not available in recovery.
Author: Kyotaro Horiguchi
Discussion: https://postgr.es/m/
20200511.101619.
2043820539323292957[email protected]
Fujii Masao [Tue, 12 May 2020 04:56:19 +0000 (13:56 +0900)]
Correct standbycheck regression test output.
Commit
2eb34ac369 changed error messages emit when commands are
rejected during recovery. But it forgot to update the standbycheck
regression test output with those error message changes.
Reported-by: Michail Nikolaev
Author: Michail Nikolaev
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/CANtu0ojFPgcspH=0nNZ+qmu0XD69sXKtVttuSoYKHawRADSQGg@mail.gmail.com
Bruce Momjian [Tue, 12 May 2020 02:58:47 +0000 (22:58 -0400)]
doc: PG 13 relnotes: add documentation section and reformat
Add section about function table reformatting.
Tom Lane [Tue, 12 May 2020 00:41:06 +0000 (20:41 -0400)]
Doc: hack table 13.2 "Conflicting Lock Modes" till it fits in PDF.
I can't see any way to make this table fit in PDF column width
without either a fundamental redesign or abbreviating EXCLUSIVE.
So I did the latter.
It'd be nicer if the abbreviating didn't leak into the HTML output
as well; but the hackery required to make the output different
seems like more trouble than it's really worth.
Discussion: https://postgr.es/m/6916.
1589146280@sss.pgh.pa.us
Bruce Momjian [Tue, 12 May 2020 01:24:08 +0000 (21:24 -0400)]
doc: PG 13 relnotes: add duplicate btree optimization details
Bruce Momjian [Tue, 12 May 2020 01:19:57 +0000 (21:19 -0400)]
doc: PG 13 relnotes: cumulative fixes from email feedback
Tom Lane [Tue, 12 May 2020 00:03:55 +0000 (20:03 -0400)]
Doc: fix remaining over-length entries in SQL keywords table.
Even after the tweaking I did in commit
5545b69ae, some of the
longer keywords mentioned in the SQL standard don't fit the
available space in PDF output.
I experimented with various solutions like putting such keywords
on their own table lines, but everything looked ugly or confusing
or both; worse, the weirdness also appeared in the HTML version,
which (normally) doesn't need it.
The best answer seems to be to insert &zwsp; into long keywords
so that they can be broken into two lines when, and only when,
needed. It doesn't look too awful if the break happens after
an underscore --- and fortunately, all the problematic keywords
have underscores.
Discussion: https://postgr.es/m/6916.
1589146280@sss.pgh.pa.us
Tom Lane [Mon, 11 May 2020 18:15:49 +0000 (14:15 -0400)]
Doc: fix "Unresolved ID reference" warnings, clean up man page cross-refs.
Use xreflabel attributes instead of endterm attributes to control the
appearance of links to subsections of SQL command reference pages.
This is simpler, it matches what we do elsewhere (e.g. for GUC variables),
and it doesn't draw "Unresolved ID reference" warnings from the PDF
toolchain.
Fix some places where the text was absolutely dependent on an <xref>
rendering exactly so, by using a <link> around the required text
instead. At least one of those spots had already been turned into
bad grammar by subsequent changes, and the whole idea is just too
fragile for my taste. <xref> does NOT have fixed output, don't write
as if it does.
Consistently include a page-level link in cross-man-page references,
because otherwise they are useless/nonsensical in man-page output.
Likewise, be consistent about mentioning "below" or "above" in same-page
references; we were doing that in about 90% of the cases, but now it's
100%.
Also get rid of another nonfunctional-in-PDF idea, of making
cross-references to functions by sticking ID tags on <row> constructs.
We can put the IDs on <indexterm>s instead --- which is probably not any
more sensible in abstract terms, but it works where the other doesn't.
(There is talk of attaching cross-reference IDs to most or all of
the docs' function descriptions, but for now I just fixed the two
that exist.)
Discussion: https://postgr.es/m/14480.
1589154358@sss.pgh.pa.us
Peter Geoghegan [Mon, 11 May 2020 18:01:07 +0000 (11:01 -0700)]
Adjust "root of to-be-deleted subtree" function.
Restructure the function that locates the root of the to-be-deleted
subtree during nbtree page deletion. Handle the conditions that make
page deletion unsafe in a slightly more uniform way, and acknowledge the
fact that the behavior with incomplete splits on internal pages is
different (as pointed out in the nbtree README as of commit
35bc0ec7).
Also invent new terminology that avoids ambiguity around which pages are
about to be deleted. Consistently use the term "to-be-deleted subtree",
not the ambiguous term "branch".
We were calling the subtree parent page the "top parent page", but that
was quite misleading. The top parent page usually refers to a page
unlinked from its siblings and marked deleted (during the second stage
of page deletion). There was one kind of top parent page that we merely
removed a downlink from, and another kind of top parent page that we
actually marked deleted. Eliminate the ambiguity by inventing a new
term ("subtree parent page") that refers to the former kind of page
only.
Alvaro Herrera [Mon, 11 May 2020 16:46:41 +0000 (12:46 -0400)]
Fix obsolete references to "XLogRead"
The one in xlogreader.h was pointed out by Antonin Houska; I (Álvaro) noticed the
others by grepping.
Author: Antonin Houska <
[email protected]>
Discussion: https://postgr.es/m/28250.
1589186654@antos
Peter Eisentraut [Mon, 11 May 2020 11:14:32 +0000 (13:14 +0200)]
Translation updates
Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git
Source-Git-Hash:
80d8f54b3c5533ec036404bd3c3b24ff4825d037
Tom Lane [Sun, 10 May 2020 20:20:28 +0000 (16:20 -0400)]
Doc: marginal hacking to remove some PDF build warnings.
This patch eliminates a few more "exceed the available area" warnings
whose causes aren't particularly connected to anything else.
The only one really worthy of comment is that I increased the space
allowed for an <orderedlist>'s numbers, because the default of 1em
doesn't quite work for more than one digit. The rest are one-off
insertions of &zwsp; and suchlike tweaks, in places where they
shouldn't do any damage to the material. (In particular, although
I split some long identifiers with zwsp's, there are other nearby
occurrences of each one; so those changes shouldn't hurt greppability
of the document sources.)
Michael Paquier [Sun, 10 May 2020 01:58:54 +0000 (10:58 +0900)]
Remove smgrdounlink() in smgr.c from the code tree
The last caller of this routine was removed in
b416691, and as a wise
man said one day, dead code tends to silently break.
Per discussion between Fujii Masao, Peter Geoghegan, Vignesh C and me.
Reported-by: Peter Geoghegan
Discussion: https://postgr.es/m/CAH2-Wz=sg5H8-vG4d5UmAofdcRMpeTDt2K-NUWp4GSfhenRGAQ@mail.gmail.com
Tom Lane [Sat, 9 May 2020 23:09:44 +0000 (19:09 -0400)]
Doc: fix assorted misstatements of fact in catalog & system view docs.
I made up a very crude hack to compare the docs with reality (as
embodied in the system catalogs) ... and indeed they don't match
everywhere. Missing oid columns, wrong data types, wrong "references"
links, columns listed in the wrong order. None of this seems quite
important enough to back-patch.
Tom Lane [Sat, 9 May 2020 20:28:09 +0000 (16:28 -0400)]
Fix findoidjoins to recognize oidvector columns.
Somehow we'd never noticed this oversight, even though it means
that such basic columns as pg_proc.proargtypes were not being
validated by the oidjoins test. Correct the query and update
the test script with the newly-found dependencies.
Tomas Vondra [Sat, 9 May 2020 17:41:42 +0000 (19:41 +0200)]
Simplify show_incremental_sort_info a bit
Incremental sort always processes at least one full group group before
switching to prefix groups, so it's enough to check just the number of
full groups. There was no risk of division by zero due to the extra
condition, but it made the code harder to understand.
Reported-by: Ranier Vilela
Discussion: https://postgr.es/m/CAEudQAp+7qoS92-4V1vLChpdY3vEkLCbf+gye6P-4cirE-0z0A@mail.gmail.com
Tomas Vondra [Sat, 9 May 2020 17:41:36 +0000 (19:41 +0200)]
Do no reset bounded before incremental sort rescan
ExecReScanIncrementalSort was resetting bounded=false, which means the
optimization would be disabled on all rescans. This happens because
ExecSetTupleBound is called before the rescan, not after it.
Author: James Coleman
Reviewed-by: Tomas Vondra
Discussion: https://postgr.es/m/
20200414065336[email protected]
Tomas Vondra [Sat, 9 May 2020 17:41:18 +0000 (19:41 +0200)]
Fix handling of REWIND/MARK/BACKWARD in incremental sort
The executor flags were not handled entirely correctly, although the
bugs were mostly harmless and it was mostly comment inaccuracy. We don't
need to strip any of the flags for child nodes.
Incremental sort does not support backward scans of mark/restore, so
MARK/BACKWARDS flags should not be possible. So we simply ensure this
using an assert, and we don't bother removing them when initializing
the child node.
With REWIND it's a bit less clear - incremental sort does not support
REWIND, but there is no way to signal this - it's legal to just ignore
the flag. We however continue passing the flag to child nodes, because
they might be useful to leverage that.
Reported-by: Michael Paquier
Author: James Coleman
Reviewed-by: Tomas Vondra
Discussion: https://postgr.es/m/
20200414065336[email protected]
Tom Lane [Sat, 9 May 2020 17:05:08 +0000 (13:05 -0400)]
Update oidjoins regression test for v13.
We seem to have forgotten to do this in the v12 cycle, so add it as
a task in the RELEASE_CHANGES list, in hopes we won't forget again.
While here, fix findoidjoins.c so that it actually works in the
new dispensation where OID is a regular column, and change it to only
consider system relations (this avoids being fooled by the OID column
in the brintest test table).
Also tweak the largeobject test so that the somewhat-recently-added
manual creation of a LO with an OID in the system range doesn't
fool findoidjoins.c. For the moment I just made that use an unused
OID, but we might have to find a more robust solution someday.
Alvaro Herrera [Fri, 8 May 2020 23:38:46 +0000 (19:38 -0400)]
pg_restore: Provide file name with one failure message
Almost all error messages already include file name where relevant, but
this one had been overlooked. Repair.
Backpatch to 9.5.
Author: Euler Taveira <
[email protected]>
Discussion: https://postgr.es/m/CAH503wA_VOrcKL_43p9atRejCDYmOZ8MzfK9S6TJrQqBqNeAXA@mail.gmail.com
Reviewed-by: Álvaro Herrera <[email protected]>
Alvaro Herrera [Fri, 8 May 2020 19:30:34 +0000 (15:30 -0400)]
Rework XLogReader callback system
Code review for
0dc8ead46363, prompted by a bug closed by
91c40548d5f7.
XLogReader's system for opening and closing segments had gotten too
complicated, with callbacks being passed at both the XLogReaderAllocate
level (read_page) as well as at the WALRead level (segment_open). This
was confusing and hard to follow, so restructure things so that these
callbacks are passed together at XLogReaderAllocate time, and add
another callback to the set (segment_close) to make it a coherent whole.
Also, ensure XLogReaderState is an argument to all the callbacks, so
that they can grab at the ->private data if necessary.
Document the whole arrangement more clearly.
Author: Álvaro Herrera <
[email protected]>
Reviewed-by: Kyotaro Horiguchi <[email protected]>
Discussion: https://postgr.es/m/
20200422175754[email protected]
Peter Eisentraut [Fri, 8 May 2020 18:35:03 +0000 (20:35 +0200)]
Improve use of prepositions in messages
*in* database, *in* cluster, *on* server; and some related fixes
Peter Eisentraut [Fri, 8 May 2020 11:33:00 +0000 (13:33 +0200)]
Unify find_other_exec() error messages
There were a few different ways to line-wrap the error messages. Make
them all the same, and use placeholders for the actual program names,
to save translation work.
Peter Eisentraut [Wed, 6 May 2020 14:25:54 +0000 (16:25 +0200)]
Fix several DDL issues of generated columns versus inheritance
Several combinations of generated columns and inheritance in CREATE
TABLE were not handled correctly. Specifically:
- Disallow a child column specifying a generation expression if the
parent column is a generated column. The child column definition
must be unadorned and the parent column's generation expression will
be copied.
- Prohibit a child column of a generated parent column specifying
default values or identity.
- Allow a child column of a not-generated parent column specifying
itself as a generated column. This previously did not work, but it
was possible to arrive at the state via other means (involving ALTER
TABLE), so it seems sensible to support it.
Add tests for each case. Also add documentation about the rules
involving generated columns and inheritance.
Discussion:
https://www.postgresql.org/message-id/flat/15830.
1575468847%40sss.pgh.pa.us
https://www.postgresql.org/message-id/flat/
2678bad1-048f-519a-ef24-
b12962f41807%40enterprisedb.com
https://www.postgresql.org/message-id/flat/CAJvUf_u4h0DxkCMCeEKAWCuzGUTnDP-G5iVmSwxLQSXn0_FWNQ%40mail.gmail.com
Peter Eisentraut [Thu, 9 Apr 2020 12:10:01 +0000 (14:10 +0200)]
Propagate ALTER TABLE ... SET STORAGE to indexes
When creating a new index, the attstorage setting of the table column
is copied to regular (non-expression) index columns. But a later
ALTER TABLE ... SET STORAGE is not propagated to indexes, thus
creating an inconsistent and undumpable state.
Discussion: https://www.postgresql.org/message-id/flat/
9765d72b-37c0-06f5-e349-
2a580aafd989%402ndquadrant.com
Amit Kapila [Fri, 8 May 2020 03:03:05 +0000 (08:33 +0530)]
Fix inconsistency in pg_buffercache docs.
Commit
6e654546fb avoids locking bufmgr partitions to make pg_buffercache
less disruptive on production systems but forgot to update the docs.
Reported-by: Sawada Masahiko
Author: Sawada Masahiko
Reviewed-by: Amit Kapila
Backpatch-through: 10
Discussion: https://postgr.es/m/CA+fd4k6sD8oeP1qJbFAor=rCpYckU9DsywHiYx3x5Hz5Z8Ua_w@mail.gmail.com
Fujii Masao [Fri, 8 May 2020 01:36:40 +0000 (10:36 +0900)]
Report missing wait event for timeline history file.
TimelineHistoryRead and TimelineHistoryWrite wait events are reported
during waiting for a read and write of a timeline history file, respectively.
However, previously, TimelineHistoryRead wait event was not reported
while readTimeLineHistory() was reading a timeline history file. Also
TimelineHistoryWrite was not reported while writeTimeLineHistory() was
writing one line with the details of the timeline split, at the end.
This commit fixes these issues.
Back-patch to v10 where wait events for a timeline history file was added.
Author: Masahiro Ikeda
Reviewed-by: Michael Paquier, Fujii Masao
Discussion: https://postgr.es/m/
d11b0c910b63684424e06772eb844ab5@oss.nttdata.com
Peter Geoghegan [Thu, 7 May 2020 23:08:54 +0000 (16:08 -0700)]
Refactor nbtree deletion INCOMPLETE_SPLIT check.
Factor out code common to _bt_lock_branch_parent() and _bt_pagedel()
into a new utility function. This new function is used to check that
the left sibling of a deletion target page does not have the
INCOMPLETE_SPLIT page flag set. If it is set then deletion is unsafe;
there won't be a usable pivot tuple (with a downlink) in the parent page
that points to the deletion target page. The page deletion algorithm is
not prepared to deal with that. Also restructure an existing, related
utility function that checks if the right sibling of the target page has
the ISHALFDEAD page flag set.
This organization highlights the symmetry between the two cases. The
goal is to make the design of page deletion clearer. Both functions
involve a sibling page with a flag that indicates that there was an
interrupted operation (a page split or a page deletion) that resulted in
a page pointed to by sibling pages, but not pointed to in the parent.
And, both functions indicate if page deletion is unsafe due to the
absence of a particular downlink in the parent page.
Tom Lane [Thu, 7 May 2020 19:59:51 +0000 (15:59 -0400)]
Fix YA text phrase search bug.
checkcondition_str() failed to report multiple matches for a prefix
pattern correctly: it would dutifully merge the match positions, but
then after exiting that loop, if the last prefix-matching word had
had no suitable positions, it would report there were no matches.
The upshot would be failing to recognize a match that the query
should match.
It looks like you need all of these conditions to see the bug:
* a phrase search (else we don't ask for match position details)
* a prefix search item (else we don't get to this code)
* a weight restriction (else checkclass_str won't fail)
Noted while investigating a problem report from Pavel Borisov,
though this is distinct from the issue he was on about.
Back-patch to 9.6 where phrase search was added.
Tom Lane [Thu, 7 May 2020 18:25:18 +0000 (14:25 -0400)]
Doc: update remaining tables of functions/operators for new layout.
This converts the contrib documentation to the new style, and mops up
a couple of function tables that were outside chapter 9 in the main
docs.
A few contrib modules choose not to present their functions in the
standard tabular format. There might be room to rethink those decisions
now that the standard format is more friendly to verbose descriptions.
But I have not undertaken to do that here; I just converted existing
tables.
Bruce Momjian [Thu, 7 May 2020 17:06:31 +0000 (13:06 -0400)]
doc: PG 13 relnotes: adjust partitioning items
Reported-by: Amit Langote
Bruce Momjian [Thu, 7 May 2020 14:01:22 +0000 (10:01 -0400)]
doc: PG 13 relnotes: adjust wording and Unicode item
Bruce Momjian [Thu, 7 May 2020 13:00:24 +0000 (09:00 -0400)]
doc: PG 13 relnotes: adjust partition items and attributions
This merges three partition publication items into two.
Bruce Momjian [Wed, 6 May 2020 23:34:22 +0000 (19:34 -0400)]
doc: PG 13 relnotes, update TOAST item to mention decompression
Reported-by: Andrey M. Borodin
Discussion: https://postgr.es/m/
D49B37B1-E2B9-4F67-8C6C-
5CFD4015E8C5@yandex-team.ru
Bruce Momjian [Wed, 6 May 2020 23:07:29 +0000 (19:07 -0400)]
pgbench: document that the default data loading is client-side
Reported-by: Fabien COELHO
Discussion: https://postgr.es/m/alpine.DEB.2.22.394.
2005051811320.
2183756@pseudo
Tom Lane [Wed, 6 May 2020 19:58:23 +0000 (15:58 -0400)]
Doc: remove now-redundant align specifications in colspecs.
In the wake of commit
f21599311, we don't need to set table columns'
align specs retail. Undo a few such settings I'd added in commit
5545b69ae. (The column width adjustments stay, though.)
Alvaro Herrera [Wed, 6 May 2020 16:29:41 +0000 (12:29 -0400)]
Heed lock protocol in DROP OWNED BY
We were acquiring object locks then deleting objects one by one, instead
of acquiring all object locks first, ignoring those that did not exist,
and then deleting all objects together. The latter is the correct
protocol to use, and what this commits changes to code to do. Failing
to follow that leads to "cache lookup failed for relation XYZ" error
reports when DROP OWNED runs concurrently with other DDL -- for example,
a session termination that removes some temp tables.
Author: Álvaro Herrera
Reported-by: Mithun Chicklore Yogendra (Mithun CY)
Reviewed-by: Ahsan Hadi, Tom Lane
Discussion: https://postgr.es/m/CADq3xVZTbzK4ZLKq+dn_vB4QafXXbmMgDP3trY-GuLnib2Ai1w@mail.gmail.com
Tom Lane [Wed, 6 May 2020 16:23:43 +0000 (12:23 -0400)]
Doc: further fooling-about with rendering of tables in PDF output.
I concluded that we really just ought to force all tables in PDF output
to default to "left" alignment (instead of "justify"); that is what the
HTML toolchain does and that's what most people have been designing the
tables to look good with. There are few if any places where "justify"
produces better-looking output, and there are many where it looks
horrible. So change stylesheet-fo.xsl to make that true.
Also tweak column widths in a few more tables to make them look better
and avoid "exceed the available area" warnings. This commit fixes
basically everything that can be fixed through that approach. The
remaining tables that give warnings either are scheduled for redesign
as per recent discussions, or need a fundamental rethink because they
Just Don't Work in a narrow view.
Michael Paquier [Wed, 6 May 2020 12:08:15 +0000 (21:08 +0900)]
Handle spaces for Python install location in MSVC scripts
Attempting to use an installation path of Python that includes spaces
caused the MSVC builds to fail. This fixes the issue by using the same
quoting method as
ad7595b for OpenSSL.
Author: Victor Wagner
Discussion: https://postgr.es/m/
20200430150608.
6dc6b8c4@antares.wagner.home
Backpatch-through: 9.5
Bruce Momjian [Tue, 5 May 2020 21:45:34 +0000 (17:45 -0400)]
doc: PG 13 relnotes, fix markup
Bruce Momjian [Tue, 5 May 2020 21:43:27 +0000 (17:43 -0400)]
doc: PG 13 renotes: adjust attribution and pgbench item
Peter Geoghegan [Tue, 5 May 2020 21:42:10 +0000 (14:42 -0700)]
Normalize _bt_findsplitloc() argument names.
Oversight in commit
bc3087b626d.
Peter Geoghegan [Tue, 5 May 2020 21:36:54 +0000 (14:36 -0700)]
Remove obsolete amcheck comment.
Oversight in commit
d114cc53.
Bruce Momjian [Tue, 5 May 2020 21:21:57 +0000 (17:21 -0400)]
doc: PG 13 relnotes, add pgbench script item
Bruce Momjian [Tue, 5 May 2020 20:31:44 +0000 (16:31 -0400)]
doc: PG 13 relnotes, add attributions and wording changes
Tom Lane [Tue, 5 May 2020 20:06:49 +0000 (16:06 -0400)]
Doc: warn that timezone abbreviations don't work in recovery_target_time.
Moving this setting into the main configuration file was ill-considered,
perhaps, because that typically causes it to be set before
timezone_abbreviations has been set. Which in turn means that zone
abbreviations don't work, only full zone names.
We could imagine hacking things so that such cases do work, but the
stability of the hack would be questionable, and the value isn't really
that high. Instead just document that you should use a numeric zone
offset or a full zone name.
Per bug #16404 from Reijo Suhonen.
Back-patch to v12 where this was changed.
Discussion: https://postgr.es/m/16404-
4603a99603fbd04c@postgresql.org
Bruce Momjian [Tue, 5 May 2020 18:40:27 +0000 (14:40 -0400)]
doc: PG 13 release note adjustments, Justin Pryzby v2
Reported-by: Justin Pryzby
Bruce Momjian [Tue, 5 May 2020 17:18:05 +0000 (13:18 -0400)]
doc: PG 13 retnote adjustments
Reported-by: Justin Pryzby
Tom Lane [Tue, 5 May 2020 17:10:09 +0000 (13:10 -0400)]
Fix severe memory leaks in GSSAPI encryption support.
Both the backend and libpq leaked buffers containing encrypted data
to be transmitted, so that the process size would grow roughly as
the total amount of data sent.
There were also far-less-critical leaks of the same sort in GSSAPI
session establishment.
Oversight in commit
b0b39f72b, which I failed to notice while
reviewing the code in
2c0cdc818.
Per complaint from pmc@citylink.
Back-patch to v12 where this code was introduced.
Discussion: https://postgr.es/m/
20200504115649[email protected]
Bruce Momjian [Tue, 5 May 2020 16:42:55 +0000 (12:42 -0400)]
doc: normalize contributor names in PG 13 release notes
Bruce Momjian [Tue, 5 May 2020 15:42:28 +0000 (11:42 -0400)]
doc: update PG 13 release notes for glossary and NO DEPENDS
Bruce Momjian [Tue, 5 May 2020 14:33:50 +0000 (10:33 -0400)]
doc: Fix PG 13 release note markup
Bruce Momjian [Tue, 5 May 2020 14:32:50 +0000 (10:32 -0400)]
doc: update PG 13 release notes after first draft
Minor corrections from individuals.
Peter Eisentraut [Tue, 5 May 2020 06:49:52 +0000 (08:49 +0200)]
Fix capitalization of messages, per style guide
Michael Paquier [Tue, 5 May 2020 05:16:01 +0000 (14:16 +0900)]
Doc: Outline REPLICATION before SUPERUSER privilege
The following docs are updated:
- High-availaility section
- pg_basebackup
- pg_receivewal
Per the principle of least privilege, we want to encourage users to
interact with those areas using roles that have replication rights, but
superusers were mentioned first.
Author: Daniel Gustafsson
Reviewed-by: Fujii Masao, Michael Paquier
Discussion: https://postgr.es/m/
ECEBD212-7101-41EB-84F3-
2F356E4B6401@yesql.se
Bruce Momjian [Tue, 5 May 2020 03:09:45 +0000 (23:09 -0400)]
doc: first draft of PG 13 release notes
This still needs markup, indenting, and word wrap.
Amit Kapila [Tue, 5 May 2020 02:30:53 +0000 (08:00 +0530)]
Change the display of WAL usage statistics in Explain.
In commit
33e05f89c5, we have added the option to display WAL usage
statistics in Explain and auto_explain. The display format used two spaces
between each field which is inconsistent with Buffer usage statistics which
is using one space between each field. Change the format to make WAL usage
statistics consistent with Buffer usage statistics.
This commit also changed the usage of "full page writes" to
"full page images" for WAL usage statistics to make it consistent with
other parts of code and docs.
Author: Julien Rouhaud, Amit Kapila
Reviewed-by: Justin Pryzby, Kyotaro Horiguchi and Amit Kapila
Discussion: https://postgr.es/m/CAB-hujrP8ZfUkvL5OYETipQwA=e3n7oqHFU=4ZLxWS_Cza3kQQ@mail.gmail.com
Tom Lane [Mon, 4 May 2020 20:16:42 +0000 (16:16 -0400)]
Doc: improve PDF presentation of some tables by adjusting column widths.
The PDF toolchain defaults to laying out all columns of a table with
equal widths, in contrast to the HTML rendering which automatically
varies the column widths to fit the data. In many places, this
results in very badly laid-out tables, with lots of useless whitespace
in some places and text that overruns its cell in other places.
For tables that have reasonably static content, we can improve
matters by adding <colspec> entries to hand-assign the column widths.
This commit does that for a few of the tables that were worst off;
it eliminates close to 200 "contents ... exceed the available area"
warnings in an A4 PDF build.
I also forced align="left" in these tables, overriding the PDF
toolchain's default which is evidently "justify". (The HTML toolchain
seems to default to that already.) Anyplace where things are tight
enough that we need to worry about this, forced justification tends to
look truly awful.
Peter Geoghegan [Mon, 4 May 2020 18:23:44 +0000 (11:23 -0700)]
Add posting list tuple amcheck test case.
Add a test case to contrib/amcheck that creates coverage of code paths
that are used to verify posting list tuples (tuples created when
deduplication merges together existing tuples to avoid a leaf page
split).
Tom Lane [Mon, 4 May 2020 17:48:30 +0000 (13:48 -0400)]
Doc: standardize markup a bit more.
We had a mishmash of <replaceable>, <replaceable class="parameter">,
and <parameter> markup for operator/function arguments. Use <parameter>
consistently for things that are in fact names of parameters (including
OUT parameters), reserving <replaceable> for things that aren't. The
latter class includes some made-up-by-the-docs type class names, like
"numeric_type", as well as placeholders for arguments that don't have
well-defined types. Possibly we could do better with those categories
as well, but for the moment I'm content not to have parameter names
marked up in different ways in different places.
(This commit aligns the earlier sections of chapter 9 with a policy
that I'd arrived at while working on commit
1ad23335f, which is why
the last few sections need no changes.)
Tom Lane [Mon, 4 May 2020 16:18:06 +0000 (12:18 -0400)]
Doc: update sections 9.22 - 9.30 for new function table layout.
With the usual quota of minor and less-minor editorial changes.
Alexander Korotkov [Sun, 3 May 2020 09:19:31 +0000 (12:19 +0300)]
Fix typo in comment
Reported-by: Oleg Bartunov
Peter Eisentraut [Sun, 3 May 2020 08:45:52 +0000 (10:45 +0200)]
Add missing newlines in error messages
Peter Geoghegan [Sat, 2 May 2020 21:04:33 +0000 (14:04 -0700)]
Refactor btvacuumpage().
Remove one of the arguments to btvacuumpage(), and give up on the idea
that it's a recursive function. We now use the term "backtracking" to
refer to the case where an earlier block must be visited to make sure no
tuples that need to be removed were missed.
Advertising btvacuumpage() as a recursive function was unhelpful. In
reality the function always simulates recursion with a loop (it doesn't
actually call itself). This wasn't just necessary as a precaution (per
the comments mentioning tail recursion), though. There is no reliable
natural limit on the number of times we can backtrack.
There are important behavioral difference when "recursing"/backtracking,
mostly related to page deletion. We don't perform page deletion when
backtracking due to the extra complexity. And when we recurse, we're
not performing a physical order scan anymore, so we expect fairly
different conditions to hold for the page. Structuring the code like
this makes it clearer how _bt_pagedel() cooperates with btvacuumpage()
and btvacuumscan() (as established in commit
b0229f26 and commit
73a076b0).
Author: Peter Geoghegan
Reviewed-By: Masahiko Sawada
Discussion: https://postgr.es/m/CAH2-WzmRGMDWiLMcb+zagG9652PboNN4Gfcq1Gc_wJL6A716MA@mail.gmail.com
Stephen Frost [Sat, 2 May 2020 15:39:26 +0000 (11:39 -0400)]
Fix GSS client to non-GSS server connection
If the client is compiled with GSSAPI support and tries to start up GSS
with the server, but the server is not compiled with GSSAPI support, we
would mistakenly end up falling through to call ProcessStartupPacket
with secure_done = true, but the client might then try to perform SSL,
which the backend wouldn't understand and we'd end up failing the
connection with:
FATAL: unsupported frontend protocol 1234.5679: server supports 2.0 to 3.0
Fix by arranging to track ssl_done independently from gss_done, instead
of trying to use the same boolean for both.
Author: Andrew Gierth
Discussion: https://postgr.es/m/
[email protected]
Backpatch: 12-, where GSSAPI encryption was added.
Tomas Vondra [Sat, 2 May 2020 13:30:10 +0000 (15:30 +0200)]
Remove superfluous memset from pgstat_recv_resetslrucounter
The extra memset meant pg_stat_reset_slru() always reset all the entries
even when reset of a single entry was requested, but the timestamp was
left uninitialized.
Reported-by: Atsushi Torikoshi
Discussion: https://postgr.es/m/CACZ0uYFe16pjZxQYaTn53mspyM7dgMPYL3DJLjjPw69GMCC2Ow%40mail.gmail.com
Tomas Vondra [Sat, 2 May 2020 13:26:47 +0000 (15:26 +0200)]
Remove pg_xact from pg_stat_reset_slru docs
This should have been included in
2e08d314ed.
Reported-by: Fujii Masao
Discussion: https://postgr.es/m/
20200119143707.gyinppnigokesjok@development
Peter Eisentraut [Sat, 2 May 2020 08:33:10 +0000 (10:33 +0200)]
Add NLS to pg_verifybackup