== PostgreSQL Weekly News - February 2, 2020 ==

From: David Fetter <david(at)fetter(dot)org>
To: PostgreSQL Announce <pgsql-announce(at)postgresql(dot)org>
Subject: == PostgreSQL Weekly News - February 2, 2020 ==
Date: 2020-02-02 23:10:49
Message-ID: 20200202231049.GA25342@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce

== PostgreSQL Weekly News - February 2, 2020 ==

PG Day Russia will be in Saint Petersburg on July 10, 2020. The CfP is open at
https://pgday.ru/en/2020/for-speakers through April 6, 2020.
https://pgday.ru/en/2020/

FOSS4G 2020, will take place in Calgary, Alberta, Canada August 24-29 2020.
the Call for Papers is currently open at https://2020.foss4g.org/speakers/ If
you submit before February 4, your paper will be eligible for early acceptance,
so consider submitting soon at https://2020.foss4g.org/early-acceptance/
https://2020.foss4g.org/

== PostgreSQL Product News ==

PostGIS 3.1.0alph1, the industry standard geographic information system package
for PostgreSQL, released.
https://postgis.net/2020/02/02/postgis-3.1.0alpha1

pgFormatter 4.2, a formatter/beautifier for SQL code, released.
http://sqlformat.darold.net/

MobilityDB 1.0 beta1, an open-source extension that adds support for temporal
and spatiotemporal objects to PostgreSQL and its spatial extension PostGIS,
released.
https://github.com/ULB-CoDE-WIT/MobilityDB

explain-running-query, an eponymous Python program, released.
https://github.com/StarfishStorage/explain-running-query

== PostgreSQL Jobs for February ==

http://archives.postgresql.org/pgsql-jobs/2020-02/

== PostgreSQL Local ==

pgDay Israel 2020 will take place on March 19, 2020 in Tel Aviv.
http://pgday.org.il/

pgDay Paris 2020 will be held in Paris, France on March 26, 2020 at Espace
Saint-Martin.
https://2020.pgday.paris/

Nordic PGDay 2020 will be held in Helsinki, Finland at the Hilton Helsinki
Strand Hotel on March 24, 2020.

PGConf India 2020 will be on February 26-28, 2020 in Bengaluru, Karnataka.
http://pgconf.in/

PostgreSQL(at)SCaLE is a two day, two track event which takes place on
March 5-6, 2020, at Pasadena Convention Center, as part of SCaLE 18X.
https://www.socallinuxexpo.org/scale/18x/postgresscale

The German-speaking PostgreSQL Conference 2020 will take place on May 15, 2019
in Stuttgart.

PGCon 2019 will take place in Ottawa on May 26-29, 2020.
https://www.pgcon.org/2020/

PGDay.IT 2020 will take place June 11-12 in Bergamo, Italy. The CfP
is open until February 8th, 2020 at midnight, as is the Call for Workshops.
https://2020.pgday.it/en/

== PostgreSQL in the News ==

Planet PostgreSQL: http://planet.postgresql.org/

PostgreSQL Weekly News is brought to you this week by David Fetter

Submit news and announcements by Sunday at 3:00pm PST8PDT to david(at)fetter(dot)org(dot)

== Applied Patches ==

Tom Lane pushed:

- In postgres_fdw, don't try to ship MULTIEXPR updates to remote server. In a
statement like "UPDATE remote_tab SET (x,y) = (SELECT ...)", we'd conclude
that the statement could be directly executed remotely, because the sub-SELECT
is in a resjunk tlist item that's not examined for shippability. Currently
that ends up crashing if the sub-SELECT contains any remote Vars. Prevent the
crash by deeming MULTIEXEC Params to be unshippable. This is a bit of a
brute-force solution, since if the sub-SELECT *doesn't* contain any remote
Vars, the current execution technology would work; but that's not a terribly
common use-case for this syntax, I think. In any case, we generally don't try
to ship sub-SELECTs, so it won't surprise anybody that this doesn't end up as
a remote direct update. I'd be inclined to see if that general limitation can
be fixed before worrying about this case further. Per report from Lukáš
Sobotka. Back-patch to 9.6. 9.5 had MULTIEXPR, but we didn't try to perform
remote direct updates then, so the case didn't arise anyway. Discussion:
https://postgr.es/m/CAJif3k+iA_ekBB5Zw2hDBaE1wtiQa4LH4_JUXrrMGwTrH0J01Q@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/215824f9188a2b19f870e6a707c5a81e1ac3f1fc

- Fix EXPLAIN (SETTINGS) to follow policy about when to print empty fields. In
non-TEXT output formats, the "Settings" field should appear when requested,
even if it would be empty. Also, get rid of the premature optimization of
counting all the GUC_EXPLAIN variables at startup. Since there was no
provision for adjusting that count later, all it'd take would be some
extension marking a parameter as GUC_EXPLAIN to risk an assertion failure or
memory stomp. We could make get_explain_guc_options() count those variables
on-the-fly, or dynamically resize its array ... but TBH I do not think that
making a transient array of pointers a bit smaller is worth any extra
complication, especially when you consider all the other transient space
EXPLAIN eats. So just allocate that array at the max possible size. In HEAD,
also add some regression test coverage for this feature. Because of the
memory-stomp hazard, back-patch to v12 where this feature was added.
Discussion: https://postgr.es/m/19416.1580069629@sss.pgh.pa.us
https://git.postgresql.org/pg/commitdiff/3ec20c7091e97a554e7447ac2b7f4ed795631395

- Apply project best practices to switches over enum values. In the wake of
1f3a02173, assorted buildfarm members were warning about "control reaches end
of non-void function" or the like. Do what we've done elsewhere: in place of
a "default" switch case that will prevent the compiler from warning about
unhandled enum values, put a catchall elog() after the switch. And return a
dummy value to satisfy compilers that don't know elog() doesn't return.
https://git.postgresql.org/pg/commitdiff/4589c6a2a30faba53d0655a8e3a29b54d28bb6f6

- Fix dangling pointer in EvalPlanQual machinery. EvalPlanQualStart() supposed
that it could re-use the relsubs_rowmark and relsubs_done arrays from a prior
instantiation. But since they are allocated in the es_query_cxt of the
recheckestate, that's just wrong; EvalPlanQualEnd() will blow away that
storage. Therefore we were using storage that could have been reallocated to
something else, causing all sorts of havoc. I think this was modeled on the
old code's handling of es_epqTupleSlot, but since the code was anyway clearing
the arrays at re-use, there's clearly no expectation of importing any outside
state. So it's just a dubious savings of a couple of pallocs, which is
negligible compared to setting up a new planstate tree. Therefore, just
allocate the arrays always. (I moved the allocations slightly for
readability.) In principle this bug could cause a problem whenever EPQ
rechecks are needed in more than one target table of a ModifyTable plan node.
In practice it seems not quite so easy to trigger as that; I couldn't readily
duplicate a crash with a partitioned target table, for instance. That's
probably down to incidental choices about when to free or reallocate stuff.
The added isolation test case does seem to reliably show an assertion failure,
though. Per report from Oleksii Kliukin. Back-patch to v12 where the bug was
introduced (evidently by commit 3fb307bc4). Discussion:
https://postgr.es/m/EEF05F66-2871-4786-992B-5F45C92FEE2E@hintbits.com
https://git.postgresql.org/pg/commitdiff/01d9676a53af075feb42d2f83ddb8c61186812fc

- Teach plpgsql's "make clean" to remove generated test files. Copy the rules
that src/test/regress/GNUmakefile uses for this purpose. Since these files are
.gitignore'd, the mistake wasn't obvious unless you happened to look at "git
status --ignored" in an allegedly clean tree. Oversight in commit 1858b105b.
No need for back-patch since that's not in the back branches.
https://git.postgresql.org/pg/commitdiff/166ab9c8d343b51e6838d7b59194d32a0019242f

- Invent "trusted" extensions, and remove the pg_pltemplate catalog. This patch
creates a new extension property, "trusted". An extension that's marked that
way in its control file can be installed by a non-superuser who has the CREATE
privilege on the current database, even if the extension contains objects that
normally would have to be created by a superuser. The objects within the
extension will (by default) be owned by the bootstrap superuser, but the
extension itself will be owned by the calling user. This allows replicating
the old behavior around trusted procedural languages, without all the
special-case logic in CREATE LANGUAGE. We have, however, chosen to loosen the
rules slightly: formerly, only a database owner could take advantage of the
special case that allowed installation of a trusted language, but now anyone
who has CREATE privilege can do so. Having done that, we can delete the
pg_pltemplate catalog, moving the knowledge it contained into the extension
script files for the various PLs. This ends up being no change at all for the
in-core PLs, but it is a large step forward for external PLs: they can now
have the same ease of installation as core PLs do. The old "trusted PL"
behavior was only available to PLs that had entries in pg_pltemplate, but now
any extension can be marked trusted if appropriate. This also removes one of
the stumbling blocks for our Python 2 -> 3 migration, since the association of
"plpythonu" with Python 2 is no longer hard-wired into pg_pltemplate's initial
contents. Exactly where we go from here on that front remains to be settled,
but one problem is fixed. Patch by me, reviewed by Peter Eisentraut, Stephen
Frost, and others. Discussion:
https://postgr.es/m/5889.1566415762@sss.pgh.pa.us
https://git.postgresql.org/pg/commitdiff/50fc694e43742ce3d04a5e9f708432cb022c5f0d

- Fix vcregress.pl for new plperl test case. As of commit 50fc694e4, the plperl
tests don't want preinstalled plperl languages; they now install those
themselves. I'd removed the --load-extension options from the GNUmakefile,
but missed teaching the MSVC build script about that. Per buildfarm.
https://git.postgresql.org/pg/commitdiff/26a81bb8152bd9f29bc24c1edfc00e2cbcd68548

- Fix test failure with non-MULTIPLICITY Perl interpreters. Per buildfarm.
https://git.postgresql.org/pg/commitdiff/2520cf8c2a0a1d679094dffbd99871884e620ed5

- In jsonb_plpython.c, suppress warning message from gcc 10. Very recent gcc
complains that PLyObject_ToJsonbValue could return a pointer to a local
variable. I think it's wrong; but the coding is fragile enough, and the
savings of one palloc() minimal enough, that it seems better to just do a
palloc() all the time. (My other idea of tweaking the if-condition doesn't
suppress the warning.) Back-patch to v11 where this code was introduced.
Discussion: https://postgr.es/m/21547.1580170366@sss.pgh.pa.us
https://git.postgresql.org/pg/commitdiff/a069218163704c44a8996e7e98e765c56e2b9c8e

- Fix parallel pg_dump/pg_restore for failure to create worker processes. If we
failed to fork a worker process, or create a communication pipe for one,
WaitForTerminatingWorkers would suffer an assertion failure if assert-enabled,
otherwise crash or go into an infinite loop. This was a consequence of not
accounting for the startup condition where we've not yet forked all the
workers. The original bug was that ParallelBackupStart would set workerStatus
to WRKR_IDLE before it had successfully forked a worker. I made things worse
in commit b7b8cc0cf by not understanding the undocumented fact that the
WRKR_TERMINATED state was also meant to represent the case where a worker
hadn't been started yet: I changed enum T_WorkerStatus so that *all* the
worker slots were initially in WRKR_IDLE state. But this wasn't any more
broken in practice, since even one slot in the wrong state would keep
WaitForTerminatingWorkers from terminating. In v10 and later, introduce an
explicit T_WorkerStatus value for worker-not-started, in hopes of preventing
future oversights of the same ilk. Before that, just document that
WRKR_TERMINATED is supposed to cover that case (partly because it wasn't
actively broken, and partly because the enum is exposed outside parallel.c in
those branches, so there's microscopically more risk involved in changing it).
In all branches, introduce a WORKER_IS_RUNNING status test macro to hide which
T_WorkerStatus values mean that, and be more careful not to access
ParallelSlot fields till we're sure they're valid. Per report from Vignesh C,
though this is my patch not his. Back-patch to all supported branches.
Discussion:
https://postgr.es/m/CALDaNm1Luv-E3sarR+-unz-BjchquHHyfP+YC+2FS2pt_J+wxg@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/2425f8f714a15fa0fa6fa2f656ad546cbb78e2d6

- Fix CheckAttributeType's handling of collations for ranges. Commit fc7695891
changed CheckAttributeType to recurse into ranges, but made it pass down the
wrong collation (always InvalidOid, since ranges as such have no collation).
This would result in guaranteed failure when considering a range type whose
subtype is collatable. Embarrassingly, we lack any regression tests that
would expose such a problem (but fortunately, somebody noticed before we
shipped this bug in any release). Fix it to pass down the range's subtype
collation property instead, and add some regression test cases to exercise
collatable-subtype ranges a bit more. Back-patch to all supported branches,
as the previous patch was. Report and patch by Julien Rouhaud, test cases
tweaked by me Discussion:
https://postgr.es/m/CAOBaU_aBWqNweiGUFX0guzBKkcfJ8mnnyyGC_KBQmO12Mj5f_A@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/74b35eb468dcf353e25afd4acfc7ee2b2022d6b6

- Fix not-quite-right string comparison in parse_jsonb_index_flags(). This code
would accept "strinX", where X is any 1-byte character, as meaning "string".
Clearly it wasn't meant to do that. No back-patch, since this doesn't affect
correct queries and there's some tiny chance we'd break somebody's incorrect
query in a minor release. Report and patch by Dominik Czarnota. Discussion:
https://postgr.es/m/CABEVAa1dU0mDCAfaT8WF2adVXTDsLVJy_izotg6ze_hh-cn8qQ@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/870ad6a59bbbd95c2dc3cfe67b07d0e079599edf

- Fix assorted error-cleanup bugs in SSL min/max protocol version code. The
error exits added to initialize_SSL() failed to clean up the partially-built
SSL_context, and some of them also leaked the result of SSLerrmessage(). Make
them match other error-handling cases in that function. The error exits added
to connectOptions2() failed to set conn->status like every other error exit in
that function. In passing, make the SSL_get_peer_certificate() error exit
look more like all the other calls of SSLerrmessage(). Oversights in commit
ff8ca5fad. Coverity whined about leakage of the SSLerrmessage() results; I
noted the rest in manual code review.
https://git.postgresql.org/pg/commitdiff/6148e2b9a6399b77e10e277c32d701b84703820f

Thomas Munro pushed:

- Refactor confusing code in _mdfd_openseg(). As reported independently by a
couple of people, _mdfd_openseg() is coded in a way that seems to imply that
the segments could be opened in an order that isn't strictly sequential. Even
if that were true, it's also using the wrong comparison. It's not an active
bug, since the condition is always true anyway, but it's confusing, so replace
it with an assertion. Author: Thomas Munro Reviewed-by: Andres Freund,
Kyotaro Horiguchi, Noah Misch Discussion:
https://postgr.es/m/CA%2BhUKG%2BNBw%2BuSzxF1os-SO6gUuw%3DcqO5DAybk6KnHKzgGvxhxA%40mail.gmail.com
Discussion: https://postgr.es/m/20191222091930.GA1280238%40rfd.leadboat.com
https://git.postgresql.org/pg/commitdiff/f37ff03478aefb5e01d748b85ad86e6213624992

- Avoid unnecessary shm writes in Parallel Hash Join. Currently, Parallel Hash
Join cannot be used for full/right joins, so there is no point in setting the
match flag. It turns out that the cache coherence traffic generated by those
writes slows down large systems running many-core joins, so let's stop doing
that. In future, if we need to use match bits in parallel joins, we might want
to consider setting them only if not already set. Back-patch to 11, where
Parallel Hash Join arrived. Reported-by: Deng, Gang Discussion:
https://postgr.es/m/0F44E799048C4849BAE4B91012DB910462E9897A%40SHSMSX103.ccr.corp.intel.com
https://git.postgresql.org/pg/commitdiff/3e4818e9dd5be294d97ca67012528cb1c0b0ccaa

- Remove dependency on HeapTuple from predicate locking functions. The following
changes make the predicate locking functions more generic and suitable for use
by future access methods: - PredicateLockTuple() is renamed to
PredicateLockTID(). It takes ItemPointer and inserting transaction ID
instead of HeapTuple. - CheckForSerializableConflictIn() takes blocknum
instead of buffer. - CheckForSerializableConflictOut() no longer takes
HeapTuple or buffer. Author: Ashwin Agrawal Reviewed-by: Andres Freund,
Kuntal Ghosh, Thomas Munro Discussion:
https://postgr.es/m/CALfoeiv0k3hkEb3Oqk%3DziWqtyk2Jys1UOK5hwRBNeANT_yX%2Bng%40mail.gmail.com
https://git.postgresql.org/pg/commitdiff/6f38d4dac381b5b8bead302a0b4f81761042cd25

- Don't reset latch in ConditionVariablePrepareToSleep(). It's not OK to do that
without calling CHECK_FOR_INTERRUPTS(). Let the next wait loop deal with it,
following the usual pattern. One consequence of this bug was that a SIGTERM
delivered in a very narrow timing window could leave a parallel worker process
waiting forever for a condition variable that will never be signaled, after an
error was raised in other process. The code is a bit different in the stable
branches due to commit 1321509f, making problems less likely there. No
back-patch for now, but we may finish up deciding to make a similar change
after more discussion. Author: Thomas Munro Reviewed-by: Shawn Debnath
Reported-by: Tomas Vondra Discussion:
https://postgr.es/m/CA%2BhUKGJOm8zZHjVA8svoNT3tHY0XdqmaC_kHitmgXDQM49m1dA%40mail.gmail.com
https://git.postgresql.org/pg/commitdiff/78aaa0e82335527b8cc91601c98c9abbbc3ef3ee

- Fix compile error on HP C. Per build farm animal anole, after commit
6f38d4dac3.
https://git.postgresql.org/pg/commitdiff/11da6bccd178c1e0d5b0fbc4bccc538f8a005dd3

- Handle lack of DSM slots in parallel btree build. If no DSM slots are
available, a ParallelContext can still be created, but its seg pointer is
NULL. Teach parallel btree build to cope with that by falling back to a
regular non-parallel build, to avoid crashing with a segmentation fault.
Back-patch to 11, where parallel CREATE INDEX landed. Reported-by: Nicola
Contu Reviewed-by: Peter Geoghegan Discussion:
https://postgr.es/m/CA%2BhUKGJgJEBnkuODBVomyK3MWFvDBbMVj%3Dgdt6DnRPU-5sQ6UQ%40mail.gmail.com
https://git.postgresql.org/pg/commitdiff/74618e77b43cfce670b4725d5b9a300a2afd12d1

- Adjust DSM and DSA slot usage constants. When running a lot of large parallel
queries concurrently, or a plan with a lot of separate Gather nodes, it is
possible to run out of DSM slots. There are better solutions to these problems
requiring architectural redesign work, but for now, let's adjust the constants
so that it's more difficult to hit the limit. 1. Previously, a DSA area
would create up to four segments at each size before doubling the size. After
this commit, it will create only two at each size, so it ramps up faster and
therefore needs fewer slots. 2. Previously, the total limit on DSM slots
allowed for 2 per connection. Switch to 5 per connection. Also remove an
obsolete nearby comment. Author: Thomas Munro Reviewed-by: Robert Haas,
Andres Freund Discussion:
https://postre.es/m/CA%2BhUKGL6H2BpGbiF7Lj6QiTjTGyTLW_vLR%3DSn2tEBeTcYXiMKw%40mail.gmail.com
https://git.postgresql.org/pg/commitdiff/d061ea21fc1cc1c657bb5c742f5c4a1564e82ee2

- Report time spent in posix_fallocate() as a wait event. When allocating DSM
segments with posix_fallocate() on Linux (see commit 899bd785), report this
activity as a wait event exactly as we would if we were using file-backed DSM
rather than shm_open()-backed DSM. Author: Thomas Munro Discussion:
https://postgr.es/m/CA%2BhUKGKCSh4GARZrJrQZwqs5SYp0xDMRr9Bvb%2BHQzJKvRgL6ZA%40mail.gmail.com
https://git.postgresql.org/pg/commitdiff/ef02fb15a35ab7bd74a79afebf35572ed82b5e9f

- Fix memory leak on DSM slot exhaustion. If we attempt to create a DSM segment
when no slots are available, we should return the memory to the operating
system. Previously we did that if the DSM_CREATE_NULL_IF_MAXSEGMENTS flag was
passed in, but we didn't do it if an error was raised. Repair. Back-patch to
9.4, where DSM segments arrived. Author: Thomas Munro Reviewed-by: Robert
Haas Reported-by: Julian Backes Discussion:
https://postgr.es/m/CA%2BhUKGKAAoEw-R4om0d2YM4eqT1eGEi6%3DQot-3ceDR-SLiWVDw%40mail.gmail.com
https://git.postgresql.org/pg/commitdiff/93745f1e019543fe7b742d0c5e971aad8d08fd56

Michaël Paquier pushed:

- Fix some memory leaks and improve restricted token handling on Windows. The
leaks have been detected by a Coverity run on Windows. No backpatch is done
as the leaks are minor. While on it, make restricted token creation more
consistent in its error handling by logging an error instead of a warning if
missing advapi32.dll, which was missing in the NT4 days. Any modern platform
should have this DLL around. Now, if the library is not there, an error is
still reported back to the caller, and nothing is done do there is no behavior
change done in this commit. Author: Ranier Vilela Discussion:
https://postgr.es/m/CAEudQApa9MG0foPkgPX87fipk=vhnF2Xfg+CfUyR08h4R7Mywg@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/10a525230fb18331dbcfd6a4a7248d76f55c331c

- Add connection parameters to control SSL protocol min/max in libpq. These two
new parameters, named sslminprotocolversion and sslmaxprotocolversion, allow
to respectively control the minimum and the maximum version of the SSL
protocol used for the SSL connection attempt. The default setting is to allow
any version for both the minimum and the maximum bounds, causing libpq to rely
on the bounds set by the backend when negotiating the protocol to use for an
SSL connection. The bounds are checked when the values are set at the
earliest stage possible as this makes the checks independent of any SSL
implementation. Author: Daniel Gustafsson Reviewed-by: Michael Paquier, Cary
Huang Discussion:
https://postgr.es/m/4F246AE3-A7AE-471E-BD3D-C799D3748E03@yesql.se
https://git.postgresql.org/pg/commitdiff/ff8ca5fadd819155c82bd16fcc6b7231af649cf8

- Fix dispsize for libpq connection parameters channel_binding and gssencmode.
channel_binding's longest allowed value is not "7", it is actually "8".
gssencmode also got that wrong. A similar mistake has been fixed as of
f4051e3. Backpatch down to v12, where gssencmode has been introduced.
Reviewed-by: Daniel Gustafsson Discussion:
https://postgr.es/m/20200128053633.GD1552@paquier.xyz Backpatch-through: 12
https://git.postgresql.org/pg/commitdiff/29e321cdd63ea48fd0223447d58f4742ad729eb0

- Fix slot data persistency when advancing physical replication slots. Advancing
a physical replication slot with pg_replication_slot_advance() did not mark
the slot as dirty if any advancing was done, preventing the follow-up
checkpoint to flush the slot data to disk. This caused the advancing to be
lost even on clean restarts. This does not happen for logical slots as any
advancing marked the slot as dirty. Per discussion, the original feature has
been implemented so as in the event of a crash the slot may move backwards to
a past LSN. This property is kept and more documentation is added about that.
This commit adds some new TAP tests to check the persistency of physical and
logical slots after advancing across clean restarts. Author: Alexey
Kondratov, Michael Paquier Reviewed-by: Andres Freund, Kyotaro Horiguchi,
Craig Ringer Discussion:
https://postgr.es/m/059cc53a-8b14-653a-a24d-5f867503b0ee@postgrespro.ru
Backpatch-through: 11
https://git.postgresql.org/pg/commitdiff/b0afdcad21fde1470e6502a376bfaf0e10d384fa

- Fix typo in recently-added TAP test for replication slots. Oversight in commit
b0afdca.
https://git.postgresql.org/pg/commitdiff/7ca8c9706a5785feef5d5eff0078c5361694b274

- Prevent running pg_basebackup as root. Similarly to pg_upgrade, pg_ctl and
initdb, a root user is able to use --version and --help, but cannot execute
the actual operation to avoid the creation of files with permissions
incompatible with the postmaster. This is a behavior change, so not
back-patching is done. Author: Ian Barwick Discussion:
https://postgr.es/m/CABvVfJVqOdD2neLkYdygdOHvbWz_5K_iWiqY+psMfA=FeAa3qQ@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/7bae0ad9fcb76b28410571dc71edfdc3175c4a02

Robert Haas pushed:

- Adjust pg_parse_json() so that it does not directly ereport(). Instead, it now
returns a value indicating either success or the type of error which occurred.
The old behavior is still available by calling pg_parse_json_or_ereport(). If
the new interface is used, an error can be thrown by passing the return value
of pg_parse_json() to json_ereport_error(). pg_parse_json() can still elog()
in can't-happen cases, but it seems like that issue is best handled
separately. Adjust json_lex() and json_count_array_elements() to return an
error code, too. This is all in preparation for making the backend's json
parser available to frontend code. Reviewed and/or tested by Mark Dilger and
Andrew Dunstan. Discussion:
http://postgr.es/m/CA+TgmoYfOXhd27MUDGioVh6QtpD0C1K-f6ObSA10AWiHBAL5bA@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/1f3a021730be98b880d94cabbe21de7e4d8136f5

- Move some code from jsonapi.c to jsonfuncs.c. Specifically, move those
functions that depend on ereport() from jsonapi.c to jsonfuncs.c, in
preparation for allowing jsonapi.c to be used from frontend code. A few cases
where elog(ERROR, ...) is used for can't-happen conditions are left alone; we
can handle those in some other way in frontend code. Reviewed by Mark Dilger
and Andrew Dunstan. Discussion:
http://postgr.es/m/CA+TgmoYfOXhd27MUDGioVh6QtpD0C1K-f6ObSA10AWiHBAL5bA@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/73ce2a03f30b52d6bfb26bc28f1e3e1aa1637577

- Move jsonapi.c and jsonapi.h to src/common. To make this work, (1)
makeJsonLexContextCstringLen now takes the encoding to be used as an argument;
(2) check_stack_depth() is made to do nothing in frontend code, and (3)
elog(ERROR, ...) is changed to pg_log_fatal + exit in frontend code. Mark
Dilger, reviewed and slightly revised by me. Discussion:
http://postgr.es/m/CA+TgmoYfOXhd27MUDGioVh6QtpD0C1K-f6ObSA10AWiHBAL5bA@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/beb4699091e9fab1c5f465056bef35c9ddf7f9fc

- Add jsonapi.c to Mkvcbuild.pm's @pgcommonallfiles. My recent commit
beb4699091e9fab1c5f465056bef35c9ddf7f9fc caused some buildfarm breakage, as
reported by Tom Lane. Try to repair. This fix is extracted from a larger
patch by Andrew Dunstan. Discussion:
http://postgr.es/m/8440ddc9-8347-ca64-1405-845d10e054cd@2ndQuadrant.com
Discussion: http://postgr.es/m/14178.1580312751@sss.pgh.pa.us
https://git.postgresql.org/pg/commitdiff/006b9dcad41956f180f9363648206fede8417592

Amit Kapila pushed:

- Added relation name in error messages for constraint checks. This gives more
information to the user about the error and it makes such messages consistent
with the other similar messages in the code. Reported-by: Simon Riggs Author:
Mahendra Singh and Simon Riggs Reviewed-by: Beena Emerson and Amit Kapila
Discussion:
https://postgr.es/m/CANP8+j+7YUvQvGxTrCiw77R23enMJ7DFmyA3buR+fa2pKs4XhA@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/05f18c6b6b6e4b44302ee20a042cedc664532aa2

- Add --parallel option to vacuumdb command. Commit 40d964ec99 allowed vacuum
command to leverage multiple CPUs by invoking parallel workers to process
indexes. This commit provides a '--parallel' option to specify the parallel
degree used by vacuum command. Author: Masahiko Sawada, with few
modifications by me Reviewed-by: Mahendra Singh and Amit Kapila Discussion:
https://postgr.es/m/CAD21AoDTPMgzSkV4E3SFo1CH_x50bf5PqZFQf4jmqjk-C03BWg@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/47bc9ced0d0e96523e2c639c7066c9aede189ed7

Heikki Linnakangas pushed:

- Fix randAccess setting in ReadRecord(). Commit 38a957316d got this backwards.
Author: Kyotaro Horiguchi Discussion:
https://www.postgresql.org/message-id/20200128.194408.2260703306774646445.horikyota.ntt@gmail.com
https://git.postgresql.org/pg/commitdiff/30012a04a6c8127397a8ab71e160d9c7e7fbe874

Peter Eisentraut pushed:

- Fail if recovery target is not reached. Before, if a recovery target is
configured, but the archive ended before the target was reached, recovery
would end and the server would promote without further notice. That was
deemed to be pretty wrong. With this change, if the recovery target is not
reached, it is a fatal error. Based-on-patch-by: Leif Gunnar Erlandsen
<leif(at)lako(dot)no> Reviewed-by: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Discussion:
https://www.postgresql.org/message-id/flat/993736dd3f1713ec1f63fc3b653839f5(at)lako(dot)no
https://git.postgresql.org/pg/commitdiff/dc788668bb269b10a108e87d14fefd1b9301b793

- Sprinkle some const decorations. This might help clarify the API a bit.
https://git.postgresql.org/pg/commitdiff/7c23bfd25c423b4513a16d41c5e4d09c32807155

- Allow building without default socket directory. We have code paths for Unix
socket support and no Unix socket support. Now add a third variant: Unix
socket support but do not use a Unix socket by default in the client or the
server, only if you explicitly specify one. This will be useful when we
enable Unix socket support on Windows. To implement this, tweak things so
that setting DEFAULT_PGSOCKET_DIR to "" has the desired effect. This mostly
already worked like that; only a few places needed to be adjusted. Notably,
the reference to DEFAULT_PGSOCKET_DIR in UNIXSOCK_PATH() could be removed
because all callers already resolve an empty socket directory setting with a
default if appropriate. Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> Discussion:
https://www.postgresql.org/message-id/75f72249-8ae6-322a-63df-4fe03eeccb9f@2ndquadrant.com
https://git.postgresql.org/pg/commitdiff/a9cff89f7e638c060621a62ca35da97a12adde42

Fujii Masao pushed:

- Make inherited TRUNCATE perform access permission checks on parent table only.
Previously, TRUNCATE command through a parent table checked the permissions on
not only the parent table but also the children tables inherited from it. This
was a bug and inherited queries should perform access permission checks on the
parent table only. This commit fixes that bug. Back-patch to all supported
branches. Author: Amit Langote Reviewed-by: Fujii Masao Discussion:
https://postgr.es/m/CAHGQGwFHdSvifhJE+-GSNqUHSfbiKxaeQQ7HGcYz6SC2n_oDcg@mail.gmail.com
https://git.postgresql.org/pg/commitdiff/e6f1e560e4c6e764080af8c8d5e76cdea4d8d00a

Álvaro Herrera pushed:

- Remove excess parens in ereport() calls. Cosmetic cleanup, not worth
backpatching. Discussion:
https://postgr.es/m/20200129200401.GA6303@alvherre.pgsql Reviewed-by: Tom
Lane, Michael Paquier
https://git.postgresql.org/pg/commitdiff/4e89c79a52f8a898edd648b56a00f0f4f840cfe7

- Clean up newlines following left parentheses. We used to strategically place
newlines after some function call left parentheses to make pgindent move the
argument list a few chars to the left, so that the whole line would fit under
80 chars. However, pgindent no longer does that, so the newlines just made
the code vertically longer for no reason. Remove those newlines, and reflow
some of those lines for some extra naturality. Reviewed-by: Michael Paquier,
Tom Lane Discussion: https://postgr.es/m/20200129200401.GA6303@alvherre.pgsql
https://git.postgresql.org/pg/commitdiff/c9d29775195922136c09cc980bb1b7091bf3d859

Andrew Gierth pushed:

- Optimizations for integer to decimal output. Using a lookup table of digit
pairs reduces the number of divisions needed, and calculating the length
upfront saves some work; these ideas are taken from the code previously
committed for floats. David Fetter, reviewed by Kyotaro Horiguchi, Tels, and
me. Discussion: https://postgr.es/m/20190924052620.GP31596%40fetter.org
https://git.postgresql.org/pg/commitdiff/1fd687a035558238c0e3cab09fc22dc61a088869

== Pending Patches ==

Justin Pryzby sent in a patch to refactor show_hinstrument and avoid showing
memory use if not verbose, and make explain analyze show stats from (hash)
aggregate.

Pavel Stěhule sent in another revision of a patch to implement schema variables.

Vik Fearing sent in another revision of a patch to add %x to PROMPT1 and PROMPT2
in psql.

Mark Dilger and Andrew Dunstan traded patches to make the JSON parser work in
front-end code.

Peter Geoghegan sent in two revisions of a patch to avoid calling
BTreeTupleGetNAtts() in _bt_compare(), inline _bt_compare(), and remove the
"negative infinity" check from _bt_compare().

Peter Eisentraut sent in another revision of a patch to allow an alias to be
attached to a JOIN ... USING.

Kyotaro HORIGUCHI sent in another revision of a patch to rework the WAL-skipping
optimization.

Dmitry Dolgov sent in another revision of a patch to implement index skip scan.

Peter Eisentraut sent in another revision of a patch to fail if recovery target
is not reached.

Álvaro Herrera sent in three revisions of a patch to use CheckPoint->time to
update latest recovery timestamp.

Justin Pryzby sent in three more revisions of a patch to ensure that vacuum
errcontext shows the block being processed, include the name of the table in the
callback for index vacuum, and add a vacuum error callback for index cleanup.

Andrey V. Lepikhov sent in another revision of a patch to remove unneeded
self-joins.

Michaël Paquier sent in a patch to add one CheckTableNotInUse() for REINDEX
CONCURRENTLY.

Thomas Munro sent in another revision of a patch to add an SQL type xid8 to
expose FullTransactionId to users, and introduce xid8 variants of the txid_XXX()
fmgr functions.

Kyotaro HORIGUCHI sent in a patch to fix the randAccess setting in ReadRecrod.

Kyotaro HORIGUCHI sent in another revision of a patch to move a callback-call
from ReadPageInternal to XLogReadRecord.

Peter Eisentraut sent in another revision of a patch to add support for other
normal forms to the Unicode normalization API, and add SQL-callable functions
for Unicode normalization.

Mike Lissner sent in a patch to document the fact that binary-coercible types
don't do index rewrites.

Robert Haas sent in two revisions of a patch to teach the MemoryContext
infrastructure not to depend on Node.

Michaël Paquier sent in a patch to fix some incorrect option sizes for
PQconninfoOption in libpq.

Mark Dilger sent in another revision of a patch to improve the
partition-matching for partitionwise join, and fix the handling of NULL
partitions, along with some tests for same.

Kyotaro HORIGUCHI sent in a patch to refactor init_from_backup.

Julien Rouhaud sent in another revision of a patch to expose the lock group
leader pid in pg_stat_activity.

Michaël Paquier sent in another revision of a patch to make physical slot
advance to be persistent.

Thomas Munro sent in another revision of a patch to pipeline functionscan.

Peter Geoghegan sent in another revision of a patch to add deduplication to
nbtree.

Amit Langote sent in another revision of a patch to support adding partitioned
tables to publications.

Julien Rouhaud sent in another revision of a patch to show planning buffers.

Mark Wong sent in another revision of a patch to implement kqueue.

Vigneshwaran C sent in a patch to update the documentation for the server
message not being displayed when the client connection is closed by the server.

Mark Dilger sent in a WIP patch to demonstrated the problem of a hash join not
finding which collation to use for string hashing.

Kyotaro HORIGUCHI sent in a patch to prevent fetching out-of-timeline segments.

Kasahara Tatsuhito sent in two revisions of a patch to fix tidscan increments
seqscan number.

Fujii Masao sent in a PoC patch to implement pg_stat_progress_basebackup.

Asif Rehman sent in another revision of a patch to implement parallel
base_backup.

Sergei Kornilov sent in another revision of a patch to test promote while
recovery target action paused, and improve recovery target action behavior.

Michael Banck and Michaël Paquier traded patches to make pg_checksums skip
foreign tablespace directories.

Álvaro Herrera fix a bug that manifested as duplicated LSN in ReorderBuffer.

Ian Barwick sent in two revisions of a patch to prevent pg_basebackup from
running as root.

曾文旌(义从) sent in another revision of a patch to implement global temporary
tables.

Michaël Paquier sent in another revision of a patch to add declaration-level
assertions, and refactor the assertion definitions in c.h.

Sergei Kornilov sent in another revision of a patch to allow online changes to
primary_conninfo in walreceiver.

Andy Fan sent in a patch to remove the distinctClause if the result is unique by
definition.

Juan José Santamaría Flecha sent in another revision of a patch to allow
localized month names to_date.

Álvaro Herrera sent in another revision of a patch to fix REPLICA IDENTITY FULL.

David Fetter sent in another revision of a patch to spread pg_bitutils into
hashing.

Julien Rouhaud sent in a patch to fix collatable_range.

Álvaro Herrera sent in a patch to widen the vacuum buffer counters.

Aleksey Kondratov sent in another revision of a patch to pg_rewind to add options
to restore WAL files from archive.

Fabien COELHO sent in another revision of a patch to pgbench to add a
pseudo-random permutation function.

Tom Lane sent in a patch to fix an issue that caused potentially malformed JSON
in EXPLAIN output by placing subnodes removed correctly.

Pierre Ducroquet sent in a patch to add support for IN clauses in dependencies
check, and add support for array contains in dependency check.

Justin Pryzby sent in a patch to preserve CLUSTER ON during ALTER TABLE.

Noah Misch sent in a patch to ensure that when a TAP file has non-zero exit
status, temporary directories are retained.

Browse pgsql-announce by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2020-02-03 13:14:40 Announcing pgday.at Austria 2020
Previous Message Mototaka Kanematsu 2020-01-31 08:47:49 High-Performance SQL Cluster Engine PGSpider released