1. 19 Apr, 2019 3 commits
  2. 18 Apr, 2019 4 commits
  3. 17 Apr, 2019 11 commits
  4. 16 Apr, 2019 4 commits
  5. 15 Apr, 2019 10 commits
  6. 14 Apr, 2019 2 commits
  7. 13 Apr, 2019 4 commits
    • Noah Misch's avatar
      When Perl "kill(9, ...)" fails, try "pg_ctl kill". · 947a3501
      Noah Misch authored
      Per buildfarm member jacana, the former fails under msys Perl 5.8.8.
      Back-patch to 9.6, like the code in question.
      
      Discussion: https://postgr.es/m/GrdLgAdUK9FdyZg8VIcTDKVOkys122ZINEb3CjjoySfGj2KyPiMKTh1zqtRp0TAD7FJ27G-OBB3eplxIB5GhcQH5o8zzGZfp0MuJaXJxVxk=@yesql.se
      947a3501
    • Tom Lane's avatar
      Prevent memory leaks associated with relcache rd_partcheck structures. · 5f1433ac
      Tom Lane authored
      The original coding of generate_partition_qual() just copied the list
      of predicate expressions into the global CacheMemoryContext, making it
      effectively impossible to clean up when the owning relcache entry is
      destroyed --- the relevant code in RelationDestroyRelation() only managed
      to free the topmost List header :-(.  This resulted in a session-lifespan
      memory leak whenever a table partition's relcache entry is rebuilt.
      Fortunately, that's not normally a large data structure, and rebuilds
      shouldn't occur all that often in production situations; but this is
      still a bug worth fixing back to v10 where the code was introduced.
      
      To fix, put the cached expression tree into its own small memory context,
      as we do with other complicated substructures of relcache entries.
      Also, deal more honestly with the case that a partition has an empty
      partcheck list; while that probably isn't a case that's very interesting
      for production use, it's legal.
      
      In passing, clarify comments about how partitioning-related relcache
      data structures are managed, and add some Asserts that we're not leaking
      old copies when we overwrite these data fields.
      
      Amit Langote and Tom Lane
      
      Discussion: https://postgr.es/m/7961.1552498252@sss.pgh.pa.us
      5f1433ac
    • Noah Misch's avatar
      Consistently test for in-use shared memory. · c0985099
      Noah Misch authored
      postmaster startup scrutinizes any shared memory segment recorded in
      postmaster.pid, exiting if that segment matches the current data
      directory and has an attached process.  When the postmaster.pid file was
      missing, a starting postmaster used weaker checks.  Change to use the
      same checks in both scenarios.  This increases the chance of a startup
      failure, in lieu of data corruption, if the DBA does "kill -9 `head -n1
      postmaster.pid` && rm postmaster.pid && pg_ctl -w start".  A postmaster
      will no longer stop if shmat() of an old segment fails with EACCES.  A
      postmaster will no longer recycle segments pertaining to other data
      directories.  That's good for production, but it's bad for integration
      tests that crash a postmaster and immediately delete its data directory.
      Such a test now leaks a segment indefinitely.  No "make check-world"
      test does that.  win32_shmem.c already avoided all these problems.  In
      9.6 and later, enhance PostgresNode to facilitate testing.  Back-patch
      to 9.4 (all supported versions).
      
      Reviewed (in earlier versions) by Daniel Gustafsson and Kyotaro HORIGUCHI.
      
      Discussion: https://postgr.es/m/20190408064141.GA2016666@rfd.leadboat.com
      c0985099
    • Michael Paquier's avatar
      Revert "Switch TAP tests of pg_rewind to use a role with minimal permissions" · db8db624
      Michael Paquier authored
      This reverts commit d4e2a843, which added a new user with limited
      permissions to run the TAP tests of pg_rewind.  Buildfarm machine
      members on Windows jacana and bowerbird have been complaining about
      that, the new role not being able to run the rewind because SSPI is not
      configured to allow it.
      
      Fixing the test requires passing down directly the new user to
      pg_regress with --create-role so as SSPI can work properly.
      
      Reported-by: Andrew Dunstan
      Discussion: https://postgr.es/m/3cd43d33-f415-cc41-ade3-7230ab15b2c9@2ndQuadrant.com
      db8db624
  8. 12 Apr, 2019 2 commits
    • Magnus Hagander's avatar
      Show shared object statistics in pg_stat_database · 77bd49ad
      Magnus Hagander authored
      This adds a row to the pg_stat_database view with datoid 0 and datname
      NULL for those objects that are not in a database. This was added
      particularly for checksums, but we were already tracking more satistics
      for these objects, just not returning it.
      
      Also add a checksum_last_failure column that holds the timestamptz of
      the last checksum failure that occurred in a database (or in a
      non-dataabase file), if any.
      
      Author: Julien Rouhaud <rjuju123@gmail.com>
      77bd49ad
    • Peter Eisentraut's avatar
      Fix REINDEX CONCURRENTLY of partitions · ef6f30fe
      Peter Eisentraut authored
      In case of a partition index, when swapping the old and new index, we
      also need to attach the new index as a partition and detach the old
      one.  Also, to handle partition indexes, we not only need to change
      dependencies referencing the index, but also dependencies of the index
      referencing something else.  The previous code did this only
      specifically for a constraint, but we also need to do this for
      partitioned indexes.  So instead write a generic function that does it
      for all dependencies.
      
      Author: Michael Paquier <michael@paquier.xyz>
      Author: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
      Discussion: https://www.postgresql.org/message-id/flat/DF4PR8401MB11964EDB77C860078C343BEBEE5A0%40DF4PR8401MB1196.NAMPRD84.PROD.OUTLOOK.COM#154df1fedb735190a773481765f7b874
      ef6f30fe