1. 15 Feb, 2020 3 commits
    • Tom Lane's avatar
      Run "make reformat-dat-files". · b78542b9
      Tom Lane authored
      Mostly to make sure the previous commit didn't break this.
      
      Discussion: https://postgr.es/m/20200212182337.GZ1412@telsasoft.com
      b78542b9
    • Tom Lane's avatar
      Don't require pg_class.dat to contain correct relnatts values. · 86ff085e
      Tom Lane authored
      Practically everybody who's ever added a column to one of the bootstrap
      catalogs has been burnt by the need to update the relnatts field in the
      initial pg_class data to match.  Now that we use Perl scripts to
      generate postgres.bki, we can have the machines take care of that,
      by filling the field during genbki.pl.
      
      While at it, use the BKI_DEFAULTS mechanism to eliminate repetitive
      specifications of other column values in pg_class.dat, too.  They
      weren't particularly a maintenance problem, but this way is prettier
      (certainly the spotty previous usage of BKI_DEFAULTS wasn't pretty).
      
      No catversion bump needed, since this doesn't actually change the
      contents of postgres.bki.
      
      Per gripe from Justin Pryzby, though this is quite different from
      his originally proposed solution.
      
      Amit Langote, John Naylor, Tom Lane
      
      Discussion: https://postgr.es/m/20200212182337.GZ1412@telsasoft.com
      86ff085e
    • Peter Geoghegan's avatar
      Recreate website's formatting for "website" doc builds. · 317906f2
      Peter Geoghegan authored
      The stylesheets used for the HTML documentation rendered on
      postgresql.org have shifted, and no longer matched what was expected by
      "make STYLE=website html" builds performed locally.  Local doc builds
      did not reflect other aspects of the website, including font and
      margins.
      
      This patch updates the references to use the current set of stylesheets
      that are used by the documentation on postgresql.org. This also wraps
      the documentation preview in a HTML container so it can keep the content
      within similar margins to those found on the website.
      
      The documentation on building the docs is updated to reflect this
      change, and to let the documentation builder know that an external
      network connection is required to properly preview documentation built
      with "make STYLE=website html" (which was true prior to this patch too,
      but not mentioned).
      
      Author: Jonathan Katz
      Reported-By: Tom Lane
      Discussion: https://postgr.es/m/1375.1581446233@sss.pgh.pa.us
      317906f2
  2. 14 Feb, 2020 2 commits
  3. 13 Feb, 2020 3 commits
    • Tom Lane's avatar
      Mark some contrib modules as "trusted". · eb67623c
      Tom Lane authored
      This allows these modules to be installed into a database without
      superuser privileges (assuming that the DBA or sysadmin has installed
      the module's files in the expected place).  You only need CREATE
      privilege on the current database, which by default would be
      available to the database owner.
      
      The following modules are marked trusted:
      
      btree_gin
      btree_gist
      citext
      cube
      dict_int
      earthdistance
      fuzzystrmatch
      hstore
      hstore_plperl
      intarray
      isn
      jsonb_plperl
      lo
      ltree
      pg_trgm
      pgcrypto
      seg
      tablefunc
      tcn
      tsm_system_rows
      tsm_system_time
      unaccent
      uuid-ossp
      
      In the future we might mark some more modules trusted, but there
      seems to be no debate about these, and on the whole it seems wise
      to be conservative with use of this feature to start out with.
      
      Discussion: https://postgr.es/m/32315.1580326876@sss.pgh.pa.us
      eb67623c
    • Jeff Davis's avatar
      Logical Tape Set: lazily allocate read buffer. · 7fdd919a
      Jeff Davis authored
      The write buffer was already lazily-allocated, so this is more
      symmetric. It also means that a freshly-rewound tape (whether for
      reading or writing) is not consuming memory for the buffer.
      
      Discussion: https://postgr.es/m/97c46a59c27f3c38e486ca170fcbc618d97ab049.camel%40j-davis.com
      7fdd919a
    • Tom Lane's avatar
      Avoid a performance regression in float overflow/underflow detection. · 607f8ce7
      Tom Lane authored
      Commit 6bf0bc84 replaced float.c's CHECKFLOATVAL() macro with static
      inline subroutines, but that wasn't too well thought out.  In the original
      coding, the unlikely condition (isinf(result) or result == 0) was checked
      first, and the inf_is_valid or zero_is_valid condition only afterwards.
      The inline-subroutine coding caused that to be swapped around, which is
      pretty horrid for performance because (a) in common cases the is_valid
      condition is twice as expensive to evaluate (e.g., requiring two isinf()
      calls not one) and (b) in common cases the is_valid condition is false,
      requiring us to perform the unlikely-condition check anyway.  Net result
      is that one isinf() call becomes two or three, resulting in visible
      performance loss as reported by Keisuke Kuroda.
      
      The original fix proposal was to revert the replacement of the macro,
      but on second thought, that macro was just a bad idea from the beginning:
      if anything it's a net negative for readability of the code.  So instead,
      let's just open-code all the overflow/underflow tests, being careful to
      test the unlikely condition first (and mark it unlikely() to help the
      compiler get the point).
      
      Also, rather than having N copies of the actual ereport() calls, collapse
      those into out-of-line error subroutines to save some code space.  This
      does mean that the error file/line numbers won't be very helpful for
      figuring out where the issue really is --- but we'd already burned that
      bridge by putting the ereports into static inlines.
      
      In HEAD, check_float[48]_val() are gone altogether.  In v12, leave them
      present in float.h but unused in the core code, just in case some
      extension is depending on them.
      
      Emre Hasegeli, with some kibitzing from me and Andres Freund
      
      Discussion: https://postgr.es/m/CANDwggLe1Gc1OrRqvPfGE=kM9K0FSfia0hbeFCEmwabhLz95AA@mail.gmail.com
      607f8ce7
  4. 12 Feb, 2020 7 commits
    • Peter Geoghegan's avatar
      Doc: Restructure B-Tree support routine docs. · caba0910
      Peter Geoghegan authored
      Use a top-level "variablelist", with one item per B-Tree support
      function.  This structure matches the structure used by various
      "Extensibility" sections in other documentation chapters for other index
      access methods.
      
      An explicit list makes it much clearer where each item begins and ends.
      This wasn't really a problem before now, but an upcoming patch that adds
      deduplication to nbtree will need to have its own new B-Tree support
      function.  Ease the burden of translators by tidying up btree.sgml ahead
      of committing the deduplication patch.
      caba0910
    • Tom Lane's avatar
      Remove long-dead comments. · 0973f560
      Tom Lane authored
      These should've been dropped by a8bb8eb5, but evidently were
      missed.  Not important enough to back-patch.
      0973f560
    • Tom Lane's avatar
      Doc: fix old oversights in GRANT/REVOKE documentation. · dce98814
      Tom Lane authored
      The GRANTED BY clause in GRANT/REVOKE ROLE has been there since 2005
      but was never documented.  I'm not sure now whether that was just an
      oversight or was intentional (given the limited capability of the
      option).  But seeing that pg_dumpall does emit code that uses this
      option, it seems like not documenting it at all is a bad idea.
      
      Also, when we upgraded the syntax to allow CURRENT_USER/SESSION_USER
      as the privilege recipient, the role form of GRANT was incorrectly
      not modified to show that, and REVOKE's docs weren't touched at all.
      
      Although I'm not that excited about GRANTED BY, the other oversight
      seems serious enough to justify a back-patch.
      
      Discussion: https://postgr.es/m/3070.1581526786@sss.pgh.pa.us
      dce98814
    • Andres Freund's avatar
      Try to harden insert-conflict-specconflict against autovacuum. · 997563df
      Andres Freund authored
      Looks like guaibasaurus had a autovacuum running during the
      controller_print_speculative_locks step (just added in
      43e08419). Which does indeed seem quite possible.
      
      Avoid the problem by only looking for the backends participating in
      the test.
      997563df
    • Michael Paquier's avatar
      Add %x to default PROMPT1 and PROMPT2 in psql · dcdbb5a5
      Michael Paquier authored
      %d can be used to track if the current connection is in a transaction
      block or not, and adding it by default to the prompt has the advantage
      to not need a modification of .psqlrc, something not possible depending
      on the environment.
      
      This discussion has happened across various sources, and there was a
      strong consensus in favor of this change.
      
      Author: Vik Fearing
      Reviewed-by: Fabien Coelho
      Discussion: https://postgr.es/m/09502c40-cfe1-bb29-10f9-4b3fa7b2bbb2@2ndquadrant.com
      dcdbb5a5
    • Andres Freund's avatar
      Test additional speculative conflict scenarios. · 43e08419
      Andres Freund authored
      Previously, the speculative insert tests did not cover the case when a
      tuple t is inserted into a table with a unique index on a column but
      before it can insert into the index, a concurrent transaction has
      inserted a conflicting value into the index and the insertion of tuple t
      must be aborted.
      
      The basic permutation is one session successfully inserts into the table
      and an associated unique index while a concurrent session successfully
      inserts into the table but discovers a conflict before inserting into
      the index and must abort the insertion.
      
      Several variants on this include:
      - swap which session is successful
      - first session insert transaction does not commit, so second session
      must wait on a transaction lock
      - first session insert does not "complete", so second session must wait
      on a speculative insertion lock
      
      Also, refactor the existing TOAST table upsert test to be in the same
      spec and reuse the steps.
      
      Author: Melanie Plageman, Ashwin Agrawal, Andres Freund
      Reviewed-by: Andres Freund, Taylor Vesely
      Discussion: https://postgr.es/m/CAAKRu_ZRmxy_OEryfY3G8Zp01ouhgw59_-_Cm8n7LzRH5BAvng@mail.gmail.com
      43e08419
    • Fujii Masao's avatar
      Fix bug in pg_basebackup -F plain -R. · be6221e9
      Fujii Masao authored
      Commit caba97a9 changed pg_basebackup -F plain -R so that
      it overwrote postgresql.auto.conf in the backup, with new connection
      setting. This could cause the existing postgresql.auto.conf settings
      in the server to get lost unexpectedly. This is a bug.
      
      This commit fixes the bug by making pg_basebackup -F plain -R
      append the connection setting into postgresql.auto.conf in the backup.
      
      Author: Fujii Masao
      Reviewed-by: Sergei Kornilov
      Discussion: https://postgr.es/m/250dcf2a-94e7-c05e-824a-73cfb38a48a4@oss.nttdata.com
      be6221e9
  5. 11 Feb, 2020 2 commits
  6. 10 Feb, 2020 11 commits
  7. 09 Feb, 2020 2 commits
  8. 07 Feb, 2020 10 commits