1. 06 Apr, 2018 13 commits
  2. 05 Apr, 2018 23 commits
  3. 04 Apr, 2018 4 commits
    • Alvaro Herrera's avatar
      Restore erroneously removed ONLY from PK check · 7d7c9979
      Alvaro Herrera authored
      This is a blind fix, since I don't have SE-Linux to verify it.
      
      Per unwanted change in rhinoceros, running sepgsql tests.  Noted by Tom
      Lane.
      
      Discussion: https://postgr.es/m/32347.1522865050@sss.pgh.pa.us
      7d7c9979
    • Stephen Frost's avatar
      Rewrite pg_dump TAP tests · 446f7f5d
      Stephen Frost authored
      This reworks how the tests to run are defined.  Instead of having to
      define all runs for all tests, we define those tests which should pass
      (generally using one of the defined broad hashes), add in any which
      should be specific for this test, and exclude any specific runs that
      shouldn't pass for this test.  This ends up removing some 4k+ lines
      (more than half the file) but, more importantly, greatly simplifies the
      way runs-to-be-tested are defined.
      
      As discussed in the updated comments, for example, take the test which
      does CREATE TABLE test_table.  That CREATE TABLE should show up in all
      'full' runs of pg_dump, except those cases where 'test_table' is
      excluded, of course, and that's exactly how the test gets defined now
      (modulo a few other related cases, like where we dump only that table,
      or we dump the schema it's in, or we exclude the schema it's in):
      
      like => {
          %full_runs,
          %dump_test_schema_runs,
          only_dump_test_table    => 1,
          section_pre_data        => 1, },
      unlike => {
          exclude_dump_test_schema => 1,
          exclude_test_table => 1, }, },
      
      Next, we no longer expect every run to be listed for every test.  If a
      run is listed in 'like' (directly or through a hash) then it's a 'like',
      unless it's listed in 'unlike' in which case it's an 'unlike'.  If it
      isn't listed in either, then it's considered an 'unlike' automatically.
      
      Lastly, this changes the code to no longer use like/unlike but rather to
      use 'ok()' with 'diag()' which allows much more control over what gets
      spit out to the screen.  Gone are the days of the entire dump being sent
      to the console, now you'll just get a couple of lines for each failing
      test which say the test that failed and the run that it failed on.
      
      This covers both the pg_dump TAP tests in src/bin/pg_dump and those in
      src/test/modules/test_pg_dump.
      446f7f5d
    • Bruce Momjian's avatar
      docs: update ltree URL for the DMOZ catalog · cd1661bb
      Bruce Momjian authored
      Reported-by: bbrincat@gmail.com
      
      Discussion: https://postgr.es/m/152283596377.1441.11672249301622760943@wrigleys.postgresql.org
      
      Author: Oleg Bartunov
      
      Backpatch-through: 9.3
      cd1661bb
    • Tom Lane's avatar
      Improve FSM management for BRIN indexes. · 1383e2a1
      Tom Lane authored
      BRIN indexes like to propagate additions of free space into the upper pages
      of their free space maps as soon as the new space is known, even when it's
      just on one individual index page.  Previously this required calling
      FreeSpaceMapVacuum, which is quite an expensive thing if the map is large.
      Use the FreeSpaceMapVacuumRange function recently added by commit c79f6df7
      to reduce the amount of work done for this purpose.
      
      Fix a couple of places that neglected to do the upper-page vacuuming at all
      after recording new free space.  If the policy is to be that BRIN should do
      that, it should do it everywhere.
      
      Do RecordPageWithFreeSpace unconditionally in brin_page_cleanup, and do
      FreeSpaceMapVacuum unconditionally in brin_vacuum_scan.  Because of the
      FSM's imprecise storage of free space, the old complications here seldom
      bought anything, they just slowed things down.  This approach also
      provides a predictable path for FSM corruption to be repaired.
      
      Remove premature RecordPageWithFreeSpace call in brin_getinsertbuffer
      where it's about to return an extended page to the caller.  The caller
      should do that, instead, after it's inserted its new tuple.  Fix the
      one caller that forgot to do so.
      
      Simplify logic in brin_doupdate's same-page-update case by postponing
      brin_initialize_empty_new_buffer to after the critical section; I see
      little point in doing it before.
      
      Avoid repeat calls of RelationGetNumberOfBlocks in brin_vacuum_scan.
      Avoid duplicate BufferGetBlockNumber and BufferGetPage calls in
      a couple of places where we already had the right values.
      
      Move a BRIN_elog debug logging call out of a critical section; that's
      pretty unsafe and I don't think it buys us anything to not wait till
      after the critical section.
      
      Move the "*extended = false" step in brin_getinsertbuffer into the
      routine's main loop.  There's no actual bug there, since the loop can't
      iterate with *extended still true, but it doesn't seem very future-proof
      as coded; and it's certainly not documented as a loop invariant.
      
      This is all from follow-on investigation inspired by commit c79f6df7.
      
      Discussion: https://postgr.es/m/5801.1522429460@sss.pgh.pa.us
      1383e2a1