1. 10 Dec, 2018 4 commits
    • Stephen Frost's avatar
      Add pg_dump test for empty OP class · eeeb1dfc
      Stephen Frost authored
      This adds a pg_dump test for an empty operator class.
      
      Author: Michael Paquier
      Discussion: https://postgr.es/m/20181208011142.GU3415@tamriel.snowman.net
      eeeb1dfc
    • Stephen Frost's avatar
      Add additional partition tests to pg_dump · 2d7eeb1b
      Stephen Frost authored
      This adds a few tests for non-inherited constraints.
      
      Author: Amit Langote
      Discussion: https://postgr.es/m/20181208001735.GT3415%40tamriel.snowman.net
      2d7eeb1b
    • Stephen Frost's avatar
      Remove dead code in toast_fetch_datum_slice · 96c702c1
      Stephen Frost authored
      In toast_fetch_datum_slice(), we Assert() that what is passed in isn't
      compressed, but we then later had a check to see what the length of if
      what was passed in is compressed.  That later check is rather confusing
      since toast_fetch_datum_slice() is only ever called with non-compressed
      datums and the Assert() earlier makes it clear that one shouldn't be
      passing in compressed datums.
      
      Add a comment to make it clear that toast_fetch_datum_slice() is just
      for non-compressed datums, and remove the dead code.
      96c702c1
    • Michael Paquier's avatar
      Ensure cleanup of orphan archive status files · 6d8727f9
      Michael Paquier authored
      When a WAL segment is recycled, its ".ready" and ".done" status files
      get also automatically removed, however this is not done in a durable
      manner.  Hence, in a subsequent crash, it could be possible that a
      ".ready" status file is still around with its corresponding segment
      already gone.
      
      If the backend reaches such a state, the archive command would most
      likely complain about a segment non-existing and would keep retrying,
      causing WAL segments to bloat pg_wal/, potentially making Postgres crash
      hard when running out of space.
      
      As status files are removed after each individual segment, using
      durable_unlink() does not completely close the window either, as a crash
      could happen between the moment the WAL segment is recycled and the
      moment its status files are removed.  This has also some performance
      impact with the additional fsync() calls needed to make the removal in a
      durable manner.  Doing the cleanup at recovery is not cost-free either
      as this makes crash recovery potentially take longer than necessary.
      
      So, instead, as per an idea of Stephen Frost, make the archiver aware of
      orphan status files and remove them on-the-fly if the corresponding
      segment goes missing.  Removal failures follow a model close to what
      happens for WAL segments, where multiple attempts are done before giving
      up temporarily, and where a successful orphan removal makes the archiver
      move immediately to the next WAL segment thought as ready to be
      archived.
      
      Author: Michael Paquier
      Reviewed-by: Nathan Bossart, Andres Freund, Stephen Frost, Kyotaro
      Horiguchi
      Discussion: https://postgr.es/m/20180928032827.GF1500@paquier.xyz
      6d8727f9
  2. 09 Dec, 2018 1 commit
  3. 07 Dec, 2018 6 commits
  4. 06 Dec, 2018 6 commits
  5. 05 Dec, 2018 2 commits
    • Alvaro Herrera's avatar
      Don't mark partitioned indexes invalid unnecessarily · 71a05b22
      Alvaro Herrera authored
      When an indexes is created on a partitioned table using ONLY (don't
      recurse to partitions), it gets marked invalid until index partitions
      are attached for each table partition.  But there's no reason to do this
      if there are no partitions ... and moreover, there's no way to get the
      index to become valid afterwards, because all partitions that get
      created/attached get their own index partition already attached to the
      parent index, so there's no chance to do ALTER INDEX ... ATTACH PARTITION
      that would make the parent index valid.
      
      Fix by not marking the index as invalid to begin with.
      
      This is very similar to 9139aa19, but the pg_dump aspect does not
      appear to be relevant until we add FKs that can point to PKs on
      partitioned tables.  (I tried to cause the pg_upgrade test to break by
      leaving some of these bogus tables around, but wasn't able to.)
      
      Making this change means that an index that was supposed to be invalid
      in the insert_conflict regression test is no longer invalid; reorder the
      DDL so that the test continues to verify the behavior we want it to.
      
      Author: Álvaro Herrera
      Reviewed-by: Amit Langote
      Discussion: https://postgr.es/m/20181203225019.2vvdef2ybnkxt364@alvherre.pgsql
      71a05b22
    • Michael Paquier's avatar
      Fix invalid value of synchronous_commit in description of flush_lag · 99f9ccee
      Michael Paquier authored
      "remote_flush" has never been a valid user-facing value, but "on" is.
      
      Author: Maksim Milyutin
      Discussion: https://postgr.es/m/27b3b80c-3615-2d76-02c5-44566b53136c@gmail.com
      99f9ccee
  6. 04 Dec, 2018 2 commits
    • Stephen Frost's avatar
      Fix typo · f502fc88
      Stephen Frost authored
      Backends don't typically exist uncleanly, but they can certainly exit
      uncleanly, and it's exiting uncleanly that's being discussed here.
      f502fc88
    • Etsuro Fujita's avatar
      postgres_fdw: Improve cost and size estimation for aggregate pushdown. · f8f6e446
      Etsuro Fujita authored
      In commit 7012b132, which added aggregate
      pushdown to postgres_fdw, we didn't account for the evaluation cost and the
      selectivity of HAVING quals attached to ForeignPaths performing aggregate
      pushdown, as core had never accounted for that for AggPaths and GroupPaths.
      And we didn't set these values of the locally-checked quals (ie, fpinfo's
      local_conds_cost and local_conds_sel), which were initialized to zeros, but
      since estimate_path_cost_size factors in these to estimate the result size
      and the evaluation cost of such a ForeignPath when the use_remote_estimate
      option is enabled, this caused it to produce underestimated results in that
      case.
      
      By commit 7b6c0754 core was changed so that
      it accounts for the evaluation cost and the selectivity of HAVING quals in
      aggregation paths, so change the postgres_fdw's aggregate pushdown code as
      well as such.  This not only fixes the underestimation issue mentioned
      above, but improves the estimation using local statistics in that function
      when that option is disabled.
      
      This would be a bug fix rather than an improvement, but apply it to HEAD
      only to avoid destabilizing existing plan choices.
      
      Author: Etsuro Fujita
      Discussion: https://postgr.es/m/5BFD3EAD.2060301%40lab.ntt.co.jp
      f8f6e446
  7. 03 Dec, 2018 3 commits
    • Tom Lane's avatar
      Refactor documentation about privileges to centralize the info. · afc4a78a
      Tom Lane authored
      Expand section 5.6 "Privileges" to include the full definition of
      each privilege type, and an explanation of aclitem privilege displays,
      along with some helpful summary tables.  Most of this material came
      out of the GRANT reference page, although some of it is new.
      Adjust a bunch of links that were pointing to GRANT to point to 5.6.
      
      Fabien Coelho and Tom Lane, reviewed by Bradley DeJong
      
      Discussion: https://postgr.es/m/alpine.DEB.2.21.1807311735200.20743@lancre
      afc4a78a
    • Michael Paquier's avatar
      Add some missing schema qualifications · ee2b37ae
      Michael Paquier authored
      This does not improve the security and reliability of the touched areas,
      but it makes the style more consistent.
      
      Author: Michael Paquier
      Reviewed-by- Noah Misch
      Discussion: https://postgr.es/m/20180309075538.GD9376@paquier.xyz
      ee2b37ae
    • Michael Paquier's avatar
      Add PGXS options to control TAP and isolation tests, take two · d3c09b9b
      Michael Paquier authored
      The following options are added for extensions:
      - TAP_TESTS, to allow an extention to run TAP tests which are the ones
      present in t/*.pl.  A subset of tests can always be run with the
      existing PROVE_TESTS for developers.
      - ISOLATION, to define a list of isolation tests.
      - ISOLATION_OPTS, to pass custom options to isolation_tester.
      
      A couple of custom Makefile rules have been accumulated across the tree
      to cover the lack of facility in PGXS for a couple of releases when
      using those test suites, which are all now replaced with the new flags,
      without reducing the test coverage.  Note that tests of contrib/bloom/
      are not enabled yet, as those are proving unstable in the buildfarm.
      
      Author: Michael Paquier
      Reviewed-by: Adam Berlin, Álvaro Herrera, Tom Lane, Nikolay Shaplov,
      Arthur Zakirov
      Discussion: https://postgr.es/m/20180906014849.GG2726@paquier.xyz
      d3c09b9b
  8. 01 Dec, 2018 3 commits
    • Tom Lane's avatar
      Eliminate parallel-make hazard in ecpg/preproc. · 29180e5d
      Tom Lane authored
      Re-making ecpglib's typename.o is dangerous because another make thread
      could be doing that at the same time.  While we've not heard field
      complaints traceable to this, it seems inevitable that it'd bite someone
      eventually.  Instead, symlink typename.c into the preproc directory and
      recompile it there.  That file is small enough that compiling it twice
      isn't much of a penalty.  Furthermore, this way we get a .o file that's
      made without shlib CFLAGS, which seems cleaner.
      
      This requires adding more stuff to the module's -I list.  The MSVC
      aspect of that is untested, but I'm sure the buildfarm will tell me
      if I got it wrong.
      
      Per a suggestion from Peter Eisentraut.  Although this is theoretically
      a bug fix, the lack of field reports makes me feel we needn't back-patch.
      
      Discussion: https://postgr.es/m/31364.1543511708@sss.pgh.pa.us
      29180e5d
    • Tom Lane's avatar
      Rename ecpg's various "extern.h" files to have distinct names. · 3295f820
      Tom Lane authored
      This should reduce confusion, and in particular make it safe to
      copy typename.c into preproc/ and compile it there.
      
      This doesn't affect anything outside ecpg, and particularly not
      end users, because these files don't get installed; they just
      exist to share declarations among the .c files of each subdirectory.
      
      Discussion: https://postgr.es/m/31364.1543511708@sss.pgh.pa.us
      3295f820
    • Tom Lane's avatar
      Add a --socketdir option to pg_upgrade. · 2d34ad84
      Tom Lane authored
      This allows control of the directory in which the postmaster sockets
      are created for the temporary postmasters started by pg_upgrade.
      The default location remains the current working directory, which is
      typically fine, but if it is deeply nested then its pathname might
      be too long to be a socket name.
      
      In passing, clean up some messiness in pg_upgrade's option handling,
      particularly the confusing and undocumented way that configuration-only
      datadirs were handled.  And fix check_required_directory's substantially
      under-baked cleanup of directory pathnames.
      
      Daniel Gustafsson, reviewed by Hironobu Suzuki, some code cleanup by me
      
      Discussion: https://postgr.es/m/E72DD5C3-2268-48A5-A907-ED4B34BEC223@yesql.se
      2d34ad84
  9. 30 Nov, 2018 5 commits
  10. 29 Nov, 2018 8 commits