== PostgreSQL Weekly News - November 24, 2019 == - Mailing list pgsql-announce

From David Fetter
Subject == PostgreSQL Weekly News - November 24, 2019 ==
Date
Msg-id 20191124175814.GA30576@fetter.org
Whole thread Raw
List pgsql-announce
== PostgreSQL Weekly News - November 24, 2019 ==

Swiss PGDay 2020 will take place in Rapperswil (near Zurich) on June 18-19, 2020.
https://www.pgday.ch/2020/

== PostgreSQL Jobs for November ==

http://archives.postgresql.org/pgsql-jobs/2019-11/

== PostgreSQL Local ==

2Q PGConf 2019 will be held December 4 & 5 in Chicago.
https://www.2qpgconf.com/

PGDay SF will take place on January 21, 2020 at the Swedish American Hall in San
Francisco.
https://2020.pgdaysf.org/callforpapers/

pgDay Israel 2020 will take place on March 19, 2020 in Tel Aviv.
The CfP is open through January 15, 2020.
http://pgday.org.il/

pgDay Paris 2020 will be held in Paris, France on March 26, 2020 at Espace
Saint-Martin. The CfP is open through December 31, 2019 at midnight, Paris time
at https://2020.pgday.paris/callforpapers/
https://2020.pgday.paris/

Nordic PGDay 2020 will be held in Helsinki, Finland at the Hilton Helsinki
Strand Hotel on March 24, 2020.  The CfP is open through December 31, 2019 at
https://2020.nordicpgday.org/cfp/

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

PostgreSQL@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. The CfP is
open through November 30, 2019.
https://www.socallinuxexpo.org/scale/18x/postgresscale

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

== 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@fetter.org.

== Applied Patches ==

Peter Geoghegan pushed:

- nbtree: Tweak _bt_pgaddtup() comments. Make it clear that _bt_pgaddtup()
  truncates the first data item on an internal page because its key is supposed
  to be treated as minus infinity within _bt_compare().
  https://git.postgresql.org/pg/commitdiff/2110f716965fe1ac5af83380aa108541b1457e0d

- Fix HeapTupleSatisfiesNonVacuumable() comment. Oversight in commit
  63746189b23.
  https://git.postgresql.org/pg/commitdiff/9f0f12ac57023653ad870a33a2e0337e6f3bf512

Amit Kapila pushed:

- Add logical_decoding_work_mem to limit ReorderBuffer memory usage. Instead of
  deciding to serialize a transaction merely based on the number of changes in
  that xact (toplevel or subxact), this makes the decisions based on amount of
  memory consumed by the changes.  The memory limit is defined by a new
  logical_decoding_work_mem GUC, so for example we can do this      SET
  logical_decoding_work_mem = '128kB'  to reduce the memory usage of walsenders
  or set the higher value to reduce disk writes. The minimum value is 64kB.
  When adding a change to a transaction, we account for the size in two places.
  Firstly, in the ReorderBuffer, which is then used to decide if we reached the
  total memory limit. And secondly in the transaction the change belongs to, so
  that we can pick the largest transaction to evict (and serialize to disk).  We
  still use max_changes_in_memory when loading changes serialized to disk. The
  trouble is we can't use the memory limit directly as there might be multiple
  subxact serialized, we need to read all of them but we don't know how many are
  there (and which subxact to read first).  We do not serialize the
  ReorderBufferTXN entries, so if there is a transaction with many subxacts,
  most memory may be in this type of objects. Those records are not included in
  the memory accounting.  We also do not account for INTERNAL_TUPLECID changes,
  which are kept in a separate list and not evicted from memory. Transactions
  with many CTID changes may consume significant amounts of memory, but we can't
  really do much about that.  The current eviction algorithm is very simple -
  the transaction is picked merely by size, while it might be useful to also
  consider age (LSN) of the changes for example. With the new Generational
  memory allocator, evicting the oldest changes would make it more likely the
  memory gets actually pfreed.  The logical_decoding_work_mem can be set in
  postgresql.conf, in which case it serves as the default for all publishers on
  that instance.  Author: Tomas Vondra, with changes by Dilip Kumar and Amit
  Kapila Reviewed-by: Dilip Kumar and Amit Kapila Tested-By: Vignesh C
  Discussion:
  https://postgr.es/m/688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com
  https://git.postgresql.org/pg/commitdiff/cec2edfa7859279f36d2374770ca920c59c73dd8

- Add the support for '-f' option in dropdb utility. Specifying '-f' will add
  the 'force' option to the DROP DATABASE command sent to the server.  This will
  try to terminate all existing connections to the target database before
  dropping it.  Author: Pavel Stehule Reviewed-by: Vignesh C and Amit Kapila
  Discussion:
  https://postgr.es/m/CAP_rwwmLJJbn70vLOZFpxGw3XD7nLB_7+NKz46H5EOO2k5H7OQ@mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/80e05a088e4edd421c9c0374d54d787c8a4c0d86

- Track statistics for spilling of changes from ReorderBuffer. This adds the
  statistics about transactions spilled to disk from ReorderBuffer.  Users can
  query the pg_stat_replication view to check these stats.  Author: Tomas
  Vondra, with bug-fixes and minor changes by Dilip Kumar Reviewed-by: Amit
  Kapila Discussion:
  https://postgr.es/m/688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com
  https://git.postgresql.org/pg/commitdiff/9290ad198b15d6b986b855d2a58d087a54777e87

Thomas Munro pushed:

- Allow invisible PROMPT2 in psql. Keep track of the visible width of PROMPT1,
  and provide %w as a way for PROMPT2 to generate the same number of spaces.
  Author: Thomas Munro, with ideas from others Reviewed-by: Tom Lane (earlier
  version) Discussion:
  https://postgr.es/m/CA%2BhUKG%2BzGd7RigjWbxwhzGW59gUpf76ydQECeGdEdodH6nd__A%40mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/7f338369ca624ca6c2e4f579623274c88d325bce

- Handle ReadFile() EOF correctly on Windows. When ReadFile() encounters the end
  of a file while reading from a synchronous handle with an offset provided via
  OVERLAPPED, it reports an error instead of returning 0.  By not handling that
  (undocumented) result correctly, we caused some noisy LOG messages about an
  unknown error code.  Repair.  Back-patch to 12, where we started using
  pread()/ReadFile() with an offset.  Reported-by: ZhenHua Cai, Amit Kapila
  Diagnosed-by: Juan Jose Santamaria Flecha Tested-by: Amit Kapila Discussion:
  https://postgr.es/m/CAA4eK1LK3%2BWRtpz68TiRdpHwxxWm%3D%2Bt1BMf-G68hhQsAQ41PZg%40mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/6969deeb8d3991cc533a5bcf451ae5eecaa9a517

Tom Lane pushed:

- Doc: clarify behavior of ALTER DEFAULT PRIVILEGES ... IN SCHEMA. The existing
  text stated that "Default privileges that are specified per-schema are added
  to whatever the global default privileges are for the particular object type".
  However, that bare-bones observation is not quite clear enough, as
  demonstrated by the complaint in bug #16124. Flesh it out by stating
  explicitly that you can't revoke built-in default privileges this way, and by
  providing an example to drive the point home.  Back-patch to all supported
  branches, since it's been like this from the beginning.  Discussion:
  https://postgr.es/m/16124-423d8ee4358421bc@postgresql.org
  https://git.postgresql.org/pg/commitdiff/787b3fd33fb3089bf80d49ef9948a6ec85005d04

- Doc: clarify use of RECURSIVE in WITH. Apparently some people misinterpreted
  the syntax as being that RECURSIVE is a prefix of individual WITH queries.
  It's a modifier for the WITH clause as a whole, so state that more clearly.
  Discussion:
  https://postgr.es/m/ca53c6ce-a0c6-b14a-a8e3-162f0b2cc119@a-kretschmer.de
  https://git.postgresql.org/pg/commitdiff/5b805886ca11d5d74217ab1f12395ad54507d4d5

- Fix corner-case failure in match_pattern_prefix(). The planner's optimization
  code for LIKE and regex operators could error out with a complaint like "no =
  operator for opfamily NNN" if someone created a binary-compatible index (for
  example, a bpchar_ops index on a text column) on the LIKE's left argument.
  This is a consequence of careless refactoring in commit 74dfe58a5. The old
  code in match_special_index_operator only accepted specific combinations of
  the pattern operator and the index opclass, thereby indirectly guaranteeing
  that the opclass would have a comparison operator with the same LHS input type
  as the pattern operator. While moving the logic out to a planner support
  function, I simplified that test in a way that no longer guarantees that.
  Really though we'd like an altogether weaker dependency on the opclass, so
  rather than put back exactly the old code, just allow lookup failure.  I have
  in mind now to rewrite this logic completely, but this is the minimum change
  needed to fix the bug in v12.  Per report from Manuel Rigger.  Back-patch to
  v12 where the mistake came in.  Discussion:
  https://postgr.es/m/CA+u7OA7nnGYy8rY0vdTe811NuA+Frr9nbcBO9u2Z+JxqNaud+g@mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/b3c265d7be42484bd0ab4a9c0a920289e8f5c995

- Doc: improve discussion of object owners' inherent privileges. In particular,
  clarify that the role membership mechanism allows members to inherit the
  ownership privileges of an object's owning role.  Laurenz Albe, with some
  kibitzing by me  Discussion:
  https://postgr.es/m/504497aca66bf34bdcdd90bd0bcebdc3a33f577b.camel@cybertec.at
  https://git.postgresql.org/pg/commitdiff/86be6453ba295c3af222ee1e27a243d378070e92

- Reduce match_pattern_prefix()'s dependencies on index opfamilies.
  Historically, the planner's LIKE/regex index optimizations were only carried
  out for specific index opfamilies.  That's never been a great idea from the
  standpoint of extensibility, but it didn't matter so much as long as we had no
  practical way to extend such behaviors anyway. With the addition of planner
  support functions, and in view of ongoing work to support additional table and
  index AMs, it seems like a good time to relax this.  Hence, recast the
  decisions in match_pattern_prefix() so that rather than decide which operators
  to generate by looking at what the index opfamily contains, we decide which
  operators to generate a-priori and then see if the opfamily supports them.
  This is much more defensible from a semantic standpoint anyway, since we know
  the semantics of the chosen operators precisely, and we only need to assume
  that the opfamily correctly implements operators it claims to support.  The
  existing "pattern" opfamilies put a crimp in this approach, since we need to
  select the pattern operators if we want those to work. So we still have to
  special-case those opfamilies.  But that seems all right, since in view of the
  addition of collations, the pattern opfamilies seem like a legacy hack that
  nobody will be building on.  The only immediate effect of this change, so far
  as the core code is concerned, is that anchored LIKE/regex patterns can be
  mapped onto BRIN index searches, and exact-match patterns can be mapped onto
  hash indexes, not only btree and spgist indexes as before.  That's not a
  terribly exciting result, but it does fix an omission mentioned in the ancient
  comments here.  Note: no catversion bump, even though this touches
  pg_operator.dat, because it's only adding OID macros not changing the contents
  of postgres.bki.  Per consideration of a report from Manuel Rigger.
  Discussion:
  https://postgr.es/m/CA+u7OA7nnGYy8rY0vdTe811NuA+Frr9nbcBO9u2Z+JxqNaud+g@mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/2ddedcafca116c99e08c777ab2ab3a4de6f00c7e

- Sync patternsel_common's operator selection logic with pattern_prefix's. Make
  patternsel_common() select the comparison operators to use with hardwired
  logic that matches pattern_prefix()'s new logic, eliminating its dependencies
  on particular index opfamilies.  This shouldn't change any behavior, as it's
  just replacing runtime operator lookups with the same values hard-wired.  But
  it makes these closely-related functions look more alike, and saving some
  runtime syscache lookups is worth something.  Actually, it's not quite true
  that this is zero behavioral change: when estimating for a column of type
  "name", the comparison constant will be kept as "text" not coerced to "name".
  But that's more correct anyway, and it allows additional simplification of the
  coercion logic, again syncing this more closely with pattern_prefix().  Per
  consideration of a report from Manuel Rigger.  Discussion:
  https://postgr.es/m/CA+u7OA7nnGYy8rY0vdTe811NuA+Frr9nbcBO9u2Z+JxqNaud+g@mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/9ff5b699ed3e2d922ff6f5660e53b51bb5db983c

- Defend against self-referential views in relation_is_updatable(). While a
  self-referential view doesn't actually work, it's possible to create one, and
  it turns out that this breaks some of the information_schema views.  Those
  views call relation_is_updatable(), which neglected to consider the hazards of
  being recursive.  In older PG versions you get a "stack depth limit exceeded"
  error, but since v10 it'd recurse to the point of stack overrun and crash,
  because commit a4c35ea1c took out the expression_returns_set() call that was
  incidentally checking the stack depth.  Since this function is only used by
  information_schema views, it seems like it'd be better to return "not
  updatable" than suffer an error.  Hence, add tracking of what views we're
  examining, in just the same way that the nearby fireRIRrules() code detects
  self-referential views.  I added a check_stack_depth() call too, just to be
  defensive.  Per private report from Manuel Rigger.  Back-patch to all
  supported versions.
  https://git.postgresql.org/pg/commitdiff/4a0aab14dcb35550b55e623a3c194442c5666084

- Fix bogus tuple-slot management in logical replication UPDATE handling.
  slot_modify_cstrings seriously abused the TupleTableSlot API by relying on a
  slot's underlying data to stay valid across ExecClearTuple.  Since this abuse
  was also quite undocumented, it's little surprise that the case got broken
  during the v12 slot rewrites.  As reported in bug #16129 from Ondřej Jirman,
  this could lead to crashes or data corruption when a logical replication
  subscriber processes a row update.  Problems would only arise if the
  subscriber's table contained columns of pass-by-ref types that were not being
  copied from the publisher.  Fix by explicitly copying the datum/isnull arrays
  from the source slot that the old row was in already.  This ends up being
  about the same thing that happened pre-v12, but hopefully in a less opaque and
  fragile way.  We might've caught the problem sooner if there were any test
  cases dealing with updates involving non-replicated or dropped columns. Now
  there are.  Back-patch to v10 where this code came in.  Even though the
  failure does not manifest before v12, IMO this code is too fragile to leave
  as-is.  In any case we certainly want the additional test coverage.  Patch by
  me; thanks to Tomas Vondra for initial investigation.  Discussion:
  https://postgr.es/m/16129-a0c0f48e71741e5f@postgresql.org
  https://git.postgresql.org/pg/commitdiff/4d9ceb0018cc087e267f978c90917b3195542e22

- Add test coverage for "unchanged toast column" replication code path. It seems
  pretty unacceptable to have no regression test coverage for this aspect of the
  logical replication protocol, especially given the bugs we've found in related
  code.  Discussion: https://postgr.es/m/16129-a0c0f48e71741e5f@postgresql.org
  https://git.postgresql.org/pg/commitdiff/f67b173771a0525ff7f2010d2d57d63d7f546352

- Avoid taking a new snapshot for an immutable simple expression in plpgsql. We
  already used this optimization if the plpgsql function is read-only. But it
  seems okay to do it even in a read-write function, if the expression contains
  only immutable functions/operators.  There would only be a change of behavior
  if an "immutable" called function depends on seeing database updates made
  during the current plpgsql function. That's enough of a violation of the
  promise of immutability that anyone who complains won't have much of a case.
  The benefits are significant --- for simple cases like    while i < 10000000
  loop     i := i + 1;   end loop;  I see net performance improvements around
  45%.  Of course, real-world cases won't get that much faster, but it ought to
  be noticeable. At the very least, this removes much of the performance penalty
  that used to exist for forgetting to mark a plpgsql function non-volatile.
  Konstantin Knizhnik, reviewed by Pavel Stehule, cosmetic changes by me
  Discussion:
  https://postgr.es/m/ed9da20e-01aa-d04b-d085-e6c16b14b9d7@postgrespro.ru
  https://git.postgresql.org/pg/commitdiff/73b06cf893c9d3bb38c11878a12cc29407e78b6c

- Make psql redisplay the query buffer after \e. Up to now, whatever you'd
  edited was put back into the query buffer but not redisplayed, which is less
  than user-friendly.  But we can improve that just by printing the text along
  with a prompt, if we enforce that the editing result ends with a newline
  (which it typically would anyway).  You then continue typing more lines if you
  want, or you can type ";" or do \g or \r or another \e.  This is intentionally
  divorced from readline's processing, for simplicity and so that it works the
  same with or without readline enabled.  We discussed possibly integrating
  things more closely with readline; but that seems difficult, uncertainly
  portable across different readline and libedit versions, and of limited real
  benefit anyway.  Let's try the simple way and see if it's good enough.  Patch
  by me, thanks to Fabien Coelho and Laurenz Albe for review  Discussion:
  https://postgr.es/m/13192.1572318028@sss.pgh.pa.us
  https://git.postgresql.org/pg/commitdiff/d1c866e57f1156000a51ff7e26590984d32bab53

Alexander Korotkov pushed:

- Fix deadlock between ginDeletePage() and ginStepRight(). When ginDeletePage()
  is about to delete page it locks its left sibling to revise the rightlink.
  So, it locks pages in right to left manner.  Int he same time ginStepRight()
  locks pages in left to right manner, and that could cause a deadlock.  This
  commit makes ginScanToDelete() keep exclusive lock on left siblings of
  currently investigated path.  That elimites need to relock left sibling in
  ginDeletePage().  Thus, deadlock with ginStepRight() can't happen anymore.
  Reported-by: Chen Huajun Discussion:
  https://postgr.es/m/5c332bd1.87b6.16d7c17aa98.Coremail.chjischj%40163.com
  Author: Alexander Korotkov Reviewed-by: Peter Geoghegan Backpatch-through: 10
  https://git.postgresql.org/pg/commitdiff/e14641197a5690d92cc48446d0d40f1aec07bac7

- Fix traversing to the deleted GIN page via downlink. Current GIN code appears
  to don't handle traversing to the deleted page via downlink.  This commit
  fixes that by stepping right from the delete page like we do in nbtree.  This
  commit also fixes setting 'deleted' flag to the GIN pages.  Now other page
  flags are not erased once page is deleted.  That helps to keep our assertions
  true if we arrive deleted page via downlink.  Discussion:
  https://postgr.es/m/CAPpHfdvMvsw-NcE5bRS7R1BbvA4BxoDnVVjkXC5W0Czvy9LVrg%40mail.gmail.com
  Author: Alexander Korotkov Reviewed-by: Peter Geoghegan Backpatch-through: 9.4
  https://git.postgresql.org/pg/commitdiff/d5ad7a09afd066dce423f282bb2b338f48614d32

- Revise GIN README. We find GIN concurrency bugs from time to time.  One of the
  problems here is that concurrency of GIN isn't well-documented in README.  So,
  it might be even hard to distinguish design bugs from implementation bugs.
  This commit revised concurrency section in GIN README providing more details.
  Some examples are illustrated in ASCII art.  Also, this commit add the
  explanation of how is tuple layout in internal GIN B-tree page different in
  comparison with nbtree.  Discussion:
  https://postgr.es/m/CAPpHfduXR_ywyaVN4%2BOYEGaw%3DcPLzWX6RxYLBncKw8de9vOkqw%40mail.gmail.com
  Author: Alexander Korotkov Reviewed-by: Peter Geoghegan Backpatch-through: 9.4
  https://git.postgresql.org/pg/commitdiff/32ca32d0bed4b95e5cd63998478a7816a89cd43d

- Fix page modification outside of critical section in GIN. By oversight
  52ac6cd2d0 makes ginDeletePage() sets pd_prune_xid of page to be deleted
  before entering the critical section.  It appears that only versions 11 and
  later were affected by this oversight.  Backpatch-through: 11
  https://git.postgresql.org/pg/commitdiff/b107140804817cc30a4069b1bb5545aa3ea0ce6c

Tatsuo Ishii pushed:

- Doc: fix minor typo in func.sgml. Discussion:
  https://postgr.es/m/20191119.222048.49467220816510881.t-ishii%40sraoss.co.jp
  https://git.postgresql.org/pg/commitdiff/eecf963269648d4309cc54f8e94508ad42bbb88b

Michaël Paquier pushed:

- Fix comment in xact.h. xl_xact_relfilenodes refers to a number of relations,
  not XIDs, whose relfilenodes are processed.  Author: Yu Kimura Discussion:
  https://postgr.es/m/a6ba6cf6bd0c990e019f008bae83437f@oss.nttdata.com
  https://git.postgresql.org/pg/commitdiff/f9cb8bd3f21719589e09bda33974d994551a63b7

- Provide statistics for hypothetical BRIN indexes. Trying to use hypothetical
  indexes with BRIN currently fails when trying to access a relation that does
  not exist when looking for the statistics.  With the current API, it is not
  possible to easily pass a value for pages_per_range down to the hypothetical
  index, so this makes use of the default value of BRIN_DEFAULT_PAGES_PER_RANGE,
  which should be fine enough in most cases.  Being able to refine or enforce
  the hypothetical costs in more optimistic ways would require more refactoring
  by filling in the statistics when building IndexOptInfo in plancat.c.  This
  would involve ABI breakages around the costing routines, something not fit for
  stable branches.  This is broken since 7e534ad, so backpatch down to v10.
  Author: Julien Rouhaud, Heikki Linnakangas Reviewed-by: Álvaro Herrera, Tom
  Lane, Michael Paquier Discussion:
  https://postgr.es/m/CAOBaU_ZH0LKEA8VFCocr6Lpte1ab0b6FpvgS0y4way+RPSXfYg@mail.gmail.com
  Backpatch-through: 10
  https://git.postgresql.org/pg/commitdiff/168d2064001f704965899bb2057591271c44e57a

- Remove traces of version-0 calling convention in src/tutorial/. Support has
  been removed as of 5ded4bd, but code related to the tutorial still used it.
  Functions using version-1 are already present for some time in the tutorial,
  and the documentation mentions them, so just replace the old version with the
  new one.  Reported-by: Pavel Stehule Analyzed-by: Euler Taveira Author:
  Michael Paquier Reviewed-by: Tom Lane, Pavel Stehule Discussion:
  https://postgr.es/m/CAFj8pRCgC2uDzrw-vvanXu6Z3ofyviEOQPEpH6_aL4OCe7JRag@mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/a9d5157ae8a7680b496d56f4edc3a43feff708c4

- Add .gitignore to src/tutorial/. A set of SQL files are generated for the
  tutorial when compiling the code, so let's avoid any risk to have them added
  in the tree in the future.
  https://git.postgresql.org/pg/commitdiff/8959a5e0fa2926b0f99e055e63fb4d81e1dcb3a0

Magnus Hagander pushed:

- Remove incorrect markup. Author: Daniel Gustafsson <daniel@yesql.se>
  https://git.postgresql.org/pg/commitdiff/a28704af42c68e659cdeeec5b5b2fc84054ae02c

Fujii Masao pushed:

- Improve tab-completion for ALTER MATERIALIZED VIEW. Author: Takao Fujii
  Reviewed-by: Fujii Masao Discussion:
  https://postgr.es/m/f9dcdef78c124517edc9e5e5880f651e@oss.nttdata.com
  https://git.postgresql.org/pg/commitdiff/61a956d9cca3f72acb279c9c00f1d9cd47bbc934

- Allow ALTER VIEW command to rename the column in the view. ALTER TABLE RENAME
  COLUMN command always can be used to rename the column in the view, but it's
  reasonable to add that syntax to ALTER VIEW too.  Author: Fujii Masao
  Reviewed-by: Ibrar Ahmed, Yu Kimura Discussion:
  https://postgr.es/m/CAHGQGwHoQMD3b-MqTLcp1MgdhCpOKU7QNRwjFooT4_d+ti5v6g@mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/30840c92ac0c4073fb7bc8222317630571b8cf25

- Make DROP DATABASE command generate less WAL records. Previously DROP DATABASE
  generated as many XLOG_DBASE_DROP WAL records as the number of tablespaces
  that the database to drop uses. This caused the scans of shared_buffers as
  many times as the number of the tablespaces during recovery because WAL replay
  of one XLOG_DBASE_DROP record needs that full scan. This could make the
  recovery time longer especially when shared_buffers is large.  This commit
  changes DROP DATABASE so that it generates only one XLOG_DBASE_DROP record,
  and registers the information of all the tablespaces into it. Then, WAL replay
  of XLOG_DBASE_DROP record needs full scan of shared_buffers only once, and
  which may improve the recovery performance.  Author: Fujii Masao Reviewed-by:
  Kirk Jamison, Simon Riggs Discussion:
  https://postgr.es/m/CAHGQGwF8YwNH0ZaL+2wjZPkj+ji9UhC+Z4ScnG97WKtVY5L9iw@mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/e6d8069522c8bde8239dd1fedfb4984efa4b3a1a

- Bump WAL version. Oversight in commit e6d8069522. Since that commit changed
  the format of XLOG_DBASE_DROP WAL record, XLOG_PAGE_MAGIC needs to be bumped.
  Spotted by Michael Paquier
  https://git.postgresql.org/pg/commitdiff/43a54a3bccd7dc6be798475214d561f3e93b3055

Peter Eisentraut pushed:

- Remove configure --disable-float4-byval. This build option was only useful to
  maintain compatibility for version-0 functions, but those are no longer
  supported, so this option can be removed.  float4 is now always pass-by-value;
  the pass-by-reference code path is completely removed.  Discussion:
  https://www.postgresql.org/message-id/flat/f3e1e576-2749-bbd7-2d57-3f9dcf75255a@2ndquadrant.com
  https://git.postgresql.org/pg/commitdiff/2e4db241bfd3206bad8286f8ffc2db6bbdaefcdf

Joe Conway pushed:

- Add object TRUNCATE hook. All operations with acl permissions checks should
  have a corresponding hook so that, for example, mandatory access control (MAC)
  may be enforced by an extension. The command TRUNCATE is missing this hook, so
  add it. Patch by Yuli Khodorkovskiy with some editorialization by me. Based on
  the discussion not back-patched. A separate patch will exercise the hook in
  the sepgsql extension.  Author: Yuli Khodorkovskiy Reviewed-by: Joe Conway
  Discussion:
  https://postgr.es/m/CAFL5wJcomybj1Xdw7qWmPJRpGuFukKgNrDb6uVBaCMgYS9dkaA%40mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/f7a2002e82cfc639d1b6df89012f5d6c623ad545

- Update sepgsql to add mandatory access control for TRUNCATE. Use SELinux
  "db_table: { truncate }" to check if permission is granted to TRUNCATE. Update
  example SELinux policy to grant needed permission for TRUNCATE. Add new
  regression test to demonstrate a positive and negative cases. Test will only
  be run if the loaded SELinux policy has the "db_table: { truncate }"
  permission. Makes use of recent commit which added object TRUNCATE hook. Patch
  by Yuli Khodorkovskiy with minor editorialization by me. Not back-patched
  because the object TRUNCATE hook was not.  Author: Yuli Khodorkovskiy
  Reviewed-by: Joe Conway Discussion:
  https://postgr.es/m/CAFL5wJcomybj1Xdw7qWmPJRpGuFukKgNrDb6uVBaCMgYS9dkaA%40mail.gmail.com
  https://git.postgresql.org/pg/commitdiff/4f66c93f61439b4db866b21cc1ecd5bf815564ef

Álvaro Herrera pushed:

- Remove debugging aid. This Assert(false) was not supposed to be in the
  committed copy.  Reported by: Tom Lane Discussion:
  https://postgr.es/m/26476.1574525468@sss.pgh.pa.us
  https://git.postgresql.org/pg/commitdiff/45ff049e288b0fc7d68195b25ba1a78522e7a45b

== Pending Patches ==

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

Andrew Gierth and David Fetter traded patches to implement reverse collations.

Amit Kapila sent in a patch to prevent shutting down Gather[Merge] early under
Limit.

Laurenz Albe and Tom Lane traded patches to clarify the permissions that come
with object ownership.

Surafel Temesgen sent in another revision of a patch to implement conflict
handling in COPY ... FROM.

Amit Langote sent in another revision of a patch to add partitioned tables to
PUBLICATIONs.

Noah Misch and Kyotaro HORIGUCHI traded patches to fix the WAL-skipping feature.

Maciek Sakrejda sent in a patch to ensure lack of duplicates in EXPLAINs.

Peter Geoghegan sent in another revision of a patch to add deduplication to
nbtree, and teach pageinspect about nbtree posting lists.

Kyotaro HORIGUCHI sent in another revision of a patch to keep syscache from
bloating with negative cache entries.

David Fetter sent in a patch to make visible_length() available to the rest of
psql.

Vigneshwaran C sent in a patch to fix an initdb crash that happened when when
createPQExpBuffer returned a NULL pointer.

Rushabh Lathia sent in two more revisions of a patch to implement backup
manifests.

Yu Kimura sent in a patch to modify xl_xact_relfilenodes attribute comment to
reflect reality.

Konstantin Knizhnik sent in another revision of a patch to implement global
temporary tables.

Justin Pryzby sent in a patch to vacuum errcontext to show block being
processed.

Michaël Paquier sent in another revision of a patch to avoid using StdRdOptions
in Access Methods.

Dilip Kumar sent in two more revisions of a patch to fix an infelicity between
logical_work_mem and logical streaming of large in-progress transactions.

Masahiko Sawada and Amit Kapila traded patches to implement block-level parallel
VACUUM.

Paul A Jungwirth sent in another revision of a patch to implement range_agg and
friends.

Antonin Houska and Álvaro Herrera traded patches to move reading of XLOG pages
to a single code path.

Aleksey Kondratov sent in another revision of a patch to enable CLUSTER, VACUUM
FULL and REINDEX to change tablespace on the fly.

Suraj Kharage sent in a patch to make it possible to check whether that backup
is validated or corruption-free without restarting the server.

Amit Langote sent in another revision of a patch to use root parent's
permissions when reading child table stats.

Michaël Paquier sent in a patch to rework the manipulation and structure of
attribute mappings.

Leif Gunnar Erlandsen sent in a patch to pause recovery if the PITR target is
not reached.

Konstantin Knizhnik sent in another revision of a patch to reduce the overhead
of SPI.

Juan José Santamaría Flecha sent in another revision of a patch to TAP to use
file_share windows file access.

Amit Kapila sent in another revision of a patch to make the order of the header
file includes consistent.

Gareth Palmer sent in another revision of a patch to implement INSERT SET.

Tatsuo Ishii sent in another revision of a patch to add support for Incremental
Materialized View Maintenance.

Jinbao Chen sent in a patch to fix an issue that manifested as planner chooosing
a much slower plan in hashjoin, using a large table as the inner table.

Peter Eisentraut sent in a patch to make lsn argument walrcv_create_slot()
optional, expose PQbackendPID() through the walreceiver API, and ensure that
walreceiver uses a temporary replication slot by default.

Etsuro Fujita sent in another revision of a patch to improve the
partition-matching algorithm for partition-wise JOINs.

Robert Haas sent in another revision of a patch to allow a choice of toast AM in
table AMs, clean up the code for toast_fetch_datum and toast_fetch_datum_slice,
move the heap-specific detoasting logic into a separate function, and add a new
callback relation_fetch_toast_slice to the table AM.

Ranier Vilela sent in a patch to fix a couple of places where a pointer variable
was being initialized with a boolean instead of NULL.

Nikita Glukhov sent in another revision of a patch to avoid full GIN index scan
when possible.

Mark Dilger sent in two revisions of a patch to fix an assertion failure in
predicate.c.

Tom Lane sent in a patch to stabilize NOTIFY report timing and queue usage
results, and fix LISTEN in SERIALIZABLE isolation.



pgsql-announce by date:

Previous
From: Euler Taveira
Date:
Subject: pgquarrel 0.6.0 released
Next
From: Christoph Berg
Date:
Subject: pg_filedump 12.0