1. 14 Jun, 2019 8 commits
  2. 13 Jun, 2019 9 commits
    • Tom Lane's avatar
      Avoid combinatorial explosion in add_child_rel_equivalences(). · d25ea012
      Tom Lane authored
      If an EquivalenceClass member expression includes variables from
      multiple appendrels, then instead of producing one substituted
      expression per child relation as intended, we'd create additional
      child expressions for combinations of children of different appendrels.
      This happened because the child expressions generated while considering
      the first appendrel were taken as sources during substitution of the
      second appendrel, and so on.  The extra expressions are useless, and are
      harmless unless there are too many of them --- but if you have several
      appendrels with a thousand or so members each, it gets bad fast.
      
      To fix, consider only original (non-em_is_child) EC members as candidates
      to be expanded.  This requires the ability to substitute directly from a
      top parent relation's Vars to those of an indirect descendant relation,
      but we already have that in adjust_appendrel_attrs_multilevel().
      
      Per bug #15847 from Feike Steenbergen.  This is a longstanding misbehavior,
      but it's only worth worrying about when there are more appendrel children
      than we've historically considered wise to use.  So I'm not going to take
      the risk of back-patching this.
      
      Discussion: https://postgr.es/m/15847-ea3734094bf8ae61@postgresql.org
      d25ea012
    • Alvaro Herrera's avatar
      Avoid spurious deadlocks when upgrading a tuple lock · de87a084
      Alvaro Herrera authored
      When two (or more) transactions are waiting for transaction T1 to release a
      tuple-level lock, and transaction T1 upgrades its lock to a higher level, a
      spurious deadlock can be reported among the waiting transactions when T1
      finishes.  The simplest example case seems to be:
      
      T1: select id from job where name = 'a' for key share;
      Y: select id from job where name = 'a' for update; -- starts waiting for X
      Z: select id from job where name = 'a' for key share;
      T1: update job set name = 'b' where id = 1;
      Z: update job set name = 'c' where id = 1; -- starts waiting for X
      T1: rollback;
      
      At this point, transaction Y is rolled back on account of a deadlock: Y
      holds the heavyweight tuple lock and is waiting for the Xmax to be released,
      while Z holds part of the multixact and tries to acquire the heavyweight
      lock (per protocol) and goes to sleep; once X releases its part of the
      multixact, Z is awakened only to be put back to sleep on the heavyweight
      lock that Y is holding while sleeping.  Kaboom.
      
      This can be avoided by having Z skip the heavyweight lock acquisition.  As
      far as I can see, the biggest downside is that if there are multiple Z
      transactions, the order in which they resume after X finishes is not
      guaranteed.
      
      Backpatch to 9.6.  The patch applies cleanly on 9.5, but the new tests don't
      work there (because isolationtester is not smart enough), so I'm not going
      to risk it.
      
      Author: Oleksii Kliukin
      Discussion: https://postgr.es/m/B9C9D7CD-EB94-4635-91B6-E558ACEC0EC3@hintbits.com
      de87a084
    • Tom Lane's avatar
      Mark ReplicationSlotCtl as PGDLLIMPORT. · 3c8f8f6e
      Tom Lane authored
      Also MyReplicationSlot, in branches where it wasn't already.
      
      This was discussed in the thread that resulted in c572599c, but
      for some reason nobody pulled the trigger.  Now that we have another
      request for the same thing, we should just do it.
      
      Craig Ringer
      
      Discussion: https://postgr.es/m/CAMsr+YFTsq-86MnsNng=mPvjjh5EAbzfMK0ptJPvzyvpFARuRg@mail.gmail.com
      Discussion: https://postgr.es/m/345138875.20190611151943@cybertec.at
      3c8f8f6e
    • Alvaro Herrera's avatar
      Fix double-word typos · b9768458
      Alvaro Herrera authored
      Discussion: https://postgr.es/m/20190612184527.GA24266@alvherre.pgsql
      Reviewed-by: Michaël Paquier
      b9768458
    • Bruce Momjian's avatar
      doc: PG 12 relnotes: update wording on truncate/vacuum item · 4f41a722
      Bruce Momjian authored
      This item prevents unauthorized locking of relations, and the previous
      wording was unclear.
      
      Reported-by: Michael Paquier
      
      Discussion: https://postgr.es/m/20190522072651.GC1278@paquier.xyz
      4f41a722
    • Etsuro Fujita's avatar
      postgres_fdw: Account for triggers in non-direct remote UPDATE planning. · 8b6da83d
      Etsuro Fujita authored
      Previously, in postgresPlanForeignModify, we planned an UPDATE operation
      on a foreign table so that we transmit only columns that were explicitly
      targets of the UPDATE, so as to avoid unnecessary data transmission, but
      if there were BEFORE ROW UPDATE triggers on the foreign table, those
      triggers might change values for non-target columns, in which case we
      would miss sending changed values for those columns.  Prevent optimizing
      away transmitting all columns if there are BEFORE ROW UPDATE triggers on
      the foreign table.
      
      This is an oversight in commit 7cbe57c3 which added triggers on foreign
      tables, so apply the patch all the way back to 9.4 where that came in.
      
      Author: Shohei Mochizuki
      Reviewed-by: Amit Langote
      Discussion: https://postgr.es/m/201905270152.x4R1q3qi014550@toshiba.co.jp
      8b6da83d
    • Tom Lane's avatar
      Doc: fix bogus example. · 7dc6ae37
      Tom Lane authored
      This wasn't incorrect SQL, but it was doing cm-to-inch conversion
      backward, so it might confuse readers.
      
      Per bug #15849 from TAKATSUKA Haruka.
      
      Discussion: https://postgr.es/m/15849-37ad0c561a836107@postgresql.org
      7dc6ae37
    • Tom Lane's avatar
      Doc: improve description of allowed spellings for Boolean input. · 9729c936
      Tom Lane authored
      datatype.sgml failed to explain that boolin() accepts any unique
      prefix of the basic input strings.  Indeed it was actively misleading
      because it called out a few minimal prefixes without mentioning that
      there were more valid inputs.
      
      I also felt that it wasn't doing anybody any favors by conflating
      SQL key words, valid Boolean input, and string literals containing
      valid Boolean input.  Rewrite in hopes of reducing the confusion.
      
      Per bug #15836 from Yuming Wang, as diagnosed by David Johnston.
      Back-patch to supported branches.
      
      Discussion: https://postgr.es/m/15836-656fab055735f511@postgresql.org
      9729c936
    • Bruce Momjian's avatar
  3. 12 Jun, 2019 6 commits
  4. 11 Jun, 2019 7 commits
  5. 10 Jun, 2019 4 commits
  6. 09 Jun, 2019 4 commits
  7. 08 Jun, 2019 2 commits
    • Noah Misch's avatar
      Update documentation about SIGKILL of postmaster. · a806b14a
      Noah Misch authored
      Removing shared memory and semaphores in response to server start
      failure often masks the real problem, a live process associated with the
      data directory; see commit 5a907404.
      Since 9.6, it's rarely necessary to kill subprocesses manually.  (When
      it is necessary, that commit's HINT will say as much, in all supported
      versions.)
      a806b14a
    • Noah Misch's avatar
      Stop using spelling "nonexistant". · f2c71cb7
      Noah Misch authored
      The documentation used "nonexistent" exclusively, and the source tree
      used it three times as often as "nonexistant".
      f2c71cb7