1. 05 Mar, 2020 7 commits
    • Tom Lane's avatar
      Remove ancient hacks to ignore certain opclass names in CREATE INDEX. · 84eca14b
      Tom Lane authored
      Twenty years ago, we removed certain operator classes in favor of
      letting indexes over their data types be built with some other
      binary-compatible, more standard opclass.  As a hack to allow existing
      index definitions to be dumped and reloaded, we made CREATE INDEX ignore
      the removed opclass names, so that such indexes would fall back to the
      new default opclass for their data types.  This was never intended to
      be a long-lived thing; it carries the obvious risk of breaking some
      future developer's attempt to re-use those old opclass names.  Since
      all of the cases in question are for opclasses that were removed
      before PG 8.0, it seems okay to get rid of these hacks now.
      
      This is part of a group of patches removing various server-side kluges
      for transparently upgrading pre-8.0 dump files.  Since we've had few
      complaints about dropping pg_dump's support for dumping from pre-8.0
      servers (commit 64f3524e), it seems okay to now remove these kluges.
      
      Discussion: https://postgr.es/m/3685.1583422389@sss.pgh.pa.us
      84eca14b
    • Tom Lane's avatar
      Remove ancient support for upgrading pre-7.3 foreign key constraints. · e58a5997
      Tom Lane authored
      Before 7.3, foreign key constraints had no explicit catalog
      representation, so that what pg_dump produced for them was (usually)
      a set of three CREATE CONSTRAINT TRIGGER commands.  Commit a2899ebd
      and some follow-on fixes added an ugly hack in CreateTrigger() to
      recognize that pattern and reconstruct the foreign key definition.
      However, we've never had any test coverage for that code, so that it's
      legitimate to wonder if it still works; and having to maintain it in
      the face of upcoming trigger-related patches seems rather pointless.
      Let's decree that its time has passed, and drop it.
      
      This is part of a group of patches removing various server-side kluges
      for transparently upgrading pre-8.0 dump files.  Since we've had few
      complaints about dropping pg_dump's support for dumping from pre-8.0
      servers (commit 64f3524e), it seems okay to now remove these kluges.
      
      Daniel Gustafsson
      
      Discussion: https://postgr.es/m/805874E2-999C-4CDA-856F-1AFBD9DFE933@yesql.se
      e58a5997
    • Alvaro Herrera's avatar
      Remove RangeIOData->typiofunc · a77315fd
      Alvaro Herrera authored
      We used to carry the I/O function OID in RangeIOData, but it's not used
      for anything.  Since the struct is not exposed to the world anyway, we
      can simplify it a bit.  Also, rename the FmgrInfo member to match
      the accompanying 'typioparam' and put them in a more sensible order.
      
      Reviewed by Tom Lane and Paul Jungwirth.
      
      Discussion: https://postgr.es/m/20200304215711.GA8732@alvherre.pgsql
      a77315fd
    • Michael Paquier's avatar
      Avoid -Wconversion warnings when using checksum_impl.h · 00651743
      Michael Paquier authored
      This does not matter much when compiling Postgres proper as many
      warnings exist when enabling this compilation flag, but it can be
      annoying for external modules willing to use both.
      
      Author: David Steele
      Discussion: https://postgr.es/m/91d86c8a-11fc-7b88-43eb-5ca3f6fb8bd3@pgmasters.net
      00651743
    • Fujii Masao's avatar
      Fix issues around .pgpass file. · 2eb3bc58
      Fujii Masao authored
      This commit fixes the following two issues around .pgpass file.
      
      (1) If the length of a line in .pgpass file was larger than 319B,
              libpq silently treated each 319B in the line as a separate
              setting line.
      
      (2) The document explains that a line beginning with # is treated
              as a comment in .pgpass. But there was no code doing such
              special handling. Whether a line begins with # or not, libpq
              just checked that the first token in the line match with the host.
      
      For (1), this commit makes libpq warn if the length of a line
      is larger than 319B, and throw away the remaining part beginning
      from 320B position.
      
      For (2), this commit changes libpq so that it treats any lines
      beginning with # as comments.
      
      Author: Fujii Masao
      Reviewed-by: Hamid Akhtar
      Discussion: https://postgr.es/m/c0f0c01c-fa74-9749-2084-b73882fd5465@oss.nttdata.com
      2eb3bc58
    • Michael Paquier's avatar
      Fix more issues with dependency handling at swap phase of REINDEX CONCURRENTLY · fbcf0871
      Michael Paquier authored
      When canceling a REINDEX CONCURRENTLY operation after swapping is done,
      a drop of the parent table would leave behind old indexes.  This is a
      consequence of 68ac9cf2, which fixed the case of pg_depend bloat when
      repeating REINDEX CONCURRENTLY on the same relation.
      
      In order to take care of the problem without breaking the previous fix,
      this uses a different strategy, possible even with the exiting set of
      routines to handle dependency changes.  The dependencies of/on the
      new index are additionally switched to the old one, allowing an old
      invalid index remaining around because of a cancellation or a failure to
      use the dependency links of the concurrently-created index.  This
      ensures that dropping any objects the old invalid index depends on also
      drops the old index automatically.
      
      Reported-by: Julien Rouhaud
      Author: Michael Paquier
      Reviewed-by: Julien Rouhaud
      Discussion: https://postgr.es/m/20200227080735.l32fqcauy73lon7o@nol
      Backpatch-through: 12
      fbcf0871
    • Jeff Davis's avatar
      Extend ExecBuildAggTrans() to support a NULL pointer check. · c954d490
      Jeff Davis authored
      Optionally push a step to check for a NULL pointer to the pergroup
      state.
      
      This will be important for disk-based hash aggregation in combination
      with grouping sets. When memory limits are reached, a given tuple may
      find its per-group state for some grouping sets but not others. For
      the former, it advances the per-group state as normal; for the latter,
      it skips evaluation and the calling code will have to spill the tuple
      and reprocess it in a later batch.
      
      Add the NULL check as a separate expression step because in some
      common cases it's not needed.
      
      Discussion: https://postgr.es/m/20200221202212.ssb2qpmdgrnx52sj%40alap3.anarazel.de
      c954d490
  2. 04 Mar, 2020 2 commits
  3. 03 Mar, 2020 8 commits
  4. 02 Mar, 2020 9 commits
  5. 01 Mar, 2020 2 commits
  6. 29 Feb, 2020 5 commits
    • Peter Geoghegan's avatar
      Doc: Fix pageinspect bt_page_items() example. · dba91533
      Peter Geoghegan authored
      Oversight in commit 93ee38ea.
      dba91533
    • Peter Geoghegan's avatar
      Teach pageinspect about nbtree deduplication. · 93ee38ea
      Peter Geoghegan authored
      Add a new bt_metap() column to display the metapage's allequalimage
      field.  Also add three new columns to contrib/pageinspect's
      bt_page_items() function:
      
      * Add a boolean column ("dead") that displays the LP_DEAD bit value for
      each non-pivot tuple.
      
      * Add a TID column ("htid") that displays a single heap TID value for
      each tuple.  This is the TID that is returned by BTreeTupleGetHeapTID(),
      so comparable values are shown for pivot tuples, plain non-pivot tuples,
      and posting list tuples.
      
      * Add a TID array column ("tids") that displays TIDs from each tuple's
      posting list, if any.  This works just like the "tids" column from
      pageinspect's gin_leafpage_items() function.
      
      No version bump for the pageinspect extension, since there hasn't been a
      stable Postgres release since the last version bump (the last bump was
      part of commit 58b4cb30).
      
      Author: Peter Geoghegan
      Discussion: https://postgr.es/m/CAH2-WzmSMmU2eNvY9+a4MNP+z02h6sa-uxZvN3un6jY02ZVBSw@mail.gmail.com
      93ee38ea
    • Tom Lane's avatar
      Correctly re-use hash tables in buildSubPlanHash(). · 58c47ccf
      Tom Lane authored
      Commit 356687bd omitted to remove leftover code for destroying
      a hashed subplan's hash tables, with the result that the tables
      were always rebuilt not reused; this leads to severe memory
      leakage if a hashed subplan is re-executed enough times.
      Moreover, the code for reusing the hashnulls table had a typo
      that would have made it do the wrong thing if it were reached.
      
      Looking at the code coverage report shows severe under-coverage
      of the potential callers of ResetTupleHashTable, so add some test
      cases that exercise them.
      
      Andreas Karlsson and Tom Lane, per reports from Ranier Vilela
      and Justin Pryzby.
      
      Backpatch to v11, as the faulty commit was.
      
      Discussion: https://postgr.es/m/edb62547-c453-c35b-3ed6-a069e4d6b937@proxel.se
      Discussion: https://postgr.es/m/CAEudQAo=DCebm1RXtig9OH+QivpS97sMkikt0A9qHmMUs+g6ZA@mail.gmail.com
      Discussion: https://postgr.es/m/20200210032547.GA1412@telsasoft.com
      58c47ccf
    • Tom Lane's avatar
      Remove obsolete comment. · 6afc8aef
      Tom Lane authored
      Noted while studying subplan hash issue.
      6afc8aef
    • Tom Lane's avatar
      Avoid failure if autovacuum tries to access a just-dropped temp namespace. · 80d76be5
      Tom Lane authored
      Such an access became possible when commit 246a6c8f added more
      aggressive cleanup of orphaned temp relations by autovacuum.
      Since autovacuum's snapshot might be slightly stale, it could
      attempt to access an already-dropped temp namespace, resulting in
      an assertion failure or null-pointer dereference.  (In practice,
      since we don't drop temp namespaces automatically but merely
      recycle them, this situation could only arise if a superuser does
      a manual drop of a temp namespace.  Still, that should be allowed.)
      
      The core of the bug, IMO, is that isTempNamespaceInUse and its callers
      failed to think hard about whether to treat "temp namespace isn't there"
      differently from "temp namespace isn't in use".  In hopes of forestalling
      future mistakes of the same ilk, replace that function with a new one
      checkTempNamespaceStatus, which makes the same tests but returns a
      three-way enum rather than just a bool.  isTempNamespaceInUse is gone
      entirely in HEAD; but just in case some external code is relying on it,
      keep it in the back branches, as a bug-compatible wrapper around the
      new function.
      
      Per report originally from Prabhat Kumar Sahu, investigated by Mahendra
      Singh and Michael Paquier; the final form of the patch is my fault.
      This replaces the failed fix attempt in a052f6cb.
      
      Backpatch as far as v11, as 246a6c8f was.
      
      Discussion: https://postgr.es/m/CAKYtNAr9Zq=1-ww4etHo-VCC-k120YxZy5OS01VkaLPaDbv2tg@mail.gmail.com
      80d76be5
  7. 28 Feb, 2020 5 commits
  8. 27 Feb, 2020 2 commits