1. 01 Apr, 2017 11 commits
    • Alvaro Herrera's avatar
      BRIN auto-summarization · 7526e102
      Alvaro Herrera authored
      Previously, only VACUUM would cause a page range to get initially
      summarized by BRIN indexes, which for some use cases takes too much time
      since the inserts occur.  To avoid the delay, have brininsert request a
      summarization run for the previous range as soon as the first tuple is
      inserted into the first page of the next range.  Autovacuum is in charge
      of processing these requests, after doing all the regular vacuuming/
      analyzing work on tables.
      
      This doesn't impose any new tasks on autovacuum, because autovacuum was
      already in charge of doing summarizations.  The only actual effect is to
      change the timing, i.e. that it occurs earlier.  For this reason, we
      don't go any great lengths to record these requests very robustly; if
      they are lost because of a server crash or restart, they will happen at
      a later time anyway.
      
      Most of the new code here is in autovacuum, which can now be told about
      "work items" to process.  This can be used for other things such as GIN
      pending list cleaning, perhaps visibility map bit setting, both of which
      are currently invoked during vacuum, but do not really depend on vacuum
      taking place.
      
      The requests are at the page range level, a granularity for which we did
      not have SQL-level access; we only had index-level summarization
      requests via brin_summarize_new_values().  It seems reasonable to add
      SQL-level access to range-level summarization too, so add a function
      brin_summarize_range() to do that.
      
      Authors: Álvaro Herrera, based on sketch from Simon Riggs.
      Reviewed-by: Thomas Munro.
      Discussion: https://postgr.es/m/20170301045823.vneqdqkmsd4as4ds@alvherre.pgsql
      7526e102
    • Magnus Hagander's avatar
      Write "waiting for checkpoint" on regular progress row · 7220c7b3
      Magnus Hagander authored
      When reporting progress, make the "waiting for checkpoint" test be
      overwritten by the file-based progress once it's completed. This is more
      consistent with how we report the rest of the progress.
      
      Suggested by Jeff Janes
      7220c7b3
    • Kevin Grittner's avatar
      Try to fix breakage of sepgsql hooks by ENR patch. · 01fd6f8f
      Kevin Grittner authored
      Turned up by buildfarm animal rhinoceros.  Fixing blind.  Will have
      to wait for next run by rhinoceros to know whether it worked.
      01fd6f8f
    • Kevin Grittner's avatar
      Add transition table support to plpgsql. · 59702716
      Kevin Grittner authored
      Kevin Grittner and Thomas Munro
      Reviewed by Heikki Linnakangas, David Fetter, and Thomas Munro
      with valuable comments and suggestions from many others
      59702716
    • Kevin Grittner's avatar
      Add infrastructure to support EphemeralNamedRelation references. · 18ce3a4a
      Kevin Grittner authored
      A QueryEnvironment concept is added, which allows new types of
      objects to be passed into queries from parsing on through
      execution.  At this point, the only thing implemented is a
      collection of EphemeralNamedRelation objects -- relations which
      can be referenced by name in queries, but do not exist in the
      catalogs.  The only type of ENR implemented is NamedTuplestore, but
      provision is made to add more types fairly easily.
      
      An ENR can carry its own TupleDesc or reference a relation in the
      catalogs by relid.
      
      Although these features can be used without SPI, convenience
      functions are added to SPI so that ENRs can easily be used by code
      run through SPI.
      
      The initial use of all this is going to be transition tables in
      AFTER triggers, but that will be added to each PL as a separate
      commit.
      
      An incidental effect of this patch is to produce a more informative
      error message if an attempt is made to modify the contents of a CTE
      from a referencing DML statement.  No tests previously covered that
      possibility, so one is added.
      
      Kevin Grittner and Thomas Munro
      Reviewed by Heikki Linnakangas, David Fetter, and Thomas Munro
      with valuable comments and suggestions from many others
      18ce3a4a
    • Robert Haas's avatar
      Avoid GatherMerge crash when there are no workers. · 25dc142a
      Robert Haas authored
      It's unnecessary to return an actual slot when we have no tuple.
      We can just return NULL, which avoids the risk of indexing into an
      array that might not contain any elements.
      
      Rushabh Lathia, per a report from Tomas Vondra
      
      Discussion: http://postgr.es/m/6ecd6f17-0dcf-1de7-ded8-0de7db1ddc88@2ndquadrant.com
      25dc142a
    • Robert Haas's avatar
      Fix parallel query so it doesn't spoil row estimates above Gather. · 7d8f6986
      Robert Haas authored
      Commit 45be99f8 removed GatherPath's
      num_workers field, but this is entirely bogus.  Normally, a path's
      parallel_workers flag is supposed to indicate the number of workers
      that it wants, and should be 0 for a non-partial path.  In that
      commit, I mistakenly thought that GatherPath could also use that field
      to indicate the number of workers that it would try to start, but
      that's disastrous, because then it can propagate up to higher nodes in
      the plan tree, which will then get incorrect rowcounts because the
      parallel_workers flag is involved in computing those values.  Repair
      by putting the separate field back.
      
      Report by Tomas Vondra.  Patch by me, reviewed by Amit Kapila.
      
      Discussion: http://postgr.es/m/f91b4a44-f739-04bd-c4b6-f135bd643669@2ndquadrant.com
      7d8f6986
    • Robert Haas's avatar
      Don't use bgw_main even to specify in-core bgworker entrypoints. · 2113ac4c
      Robert Haas authored
      On EXEC_BACKEND builds, this can fail if ASLR is in use.
      
      Backpatch to 9.5.  On master, completely remove the bgw_main field
      completely, since there is no situation in which it is safe for an
      EXEC_BACKEND build.  On 9.6 and 9.5, leave the field intact to avoid
      breaking things for third-party code that doesn't care about working
      under EXEC_BACKEND.  Prior to 9.5, there are no in-core bgworker
      entrypoints.
      
      Petr Jelinek, reviewed by me.
      
      Discussion: http://postgr.es/m/09d8ad33-4287-a09b-a77f-77f8761adb5e@2ndquadrant.com
      2113ac4c
    • Tom Lane's avatar
      Fix unstable regression test result. · c281cd5f
      Tom Lane authored
      Whoops, missed that same test was made for json as well as jsonb.
      c281cd5f
    • Tom Lane's avatar
      Fix unstable regression test result. · f1a285e2
      Tom Lane authored
      Commit e306df7f added a test case that depends on "the" being a
      stop word, which it is not in non-English locales.  Since the
      point of the test is to check stopword behavior, fix by forcibly
      selecting the 'english' configuration.
      
      Per buildfarm.
      f1a285e2
    • Robert Haas's avatar
      Fix typos. · 9a12ad04
      Robert Haas authored
      Brandur Leach
      9a12ad04
  2. 31 Mar, 2017 8 commits
  3. 30 Mar, 2017 8 commits
    • Tom Lane's avatar
      Fix broken markup. · ab1e6440
      Tom Lane authored
      Per buildfarm.
      ab1e6440
    • Simon Riggs's avatar
      Fix pgrowlocks minor coding oversight · ceb3158a
      Simon Riggs authored
      ceb3158a
    • Simon Riggs's avatar
      Default monitoring roles · 25fff407
      Simon Riggs authored
      Three nologin roles with non-overlapping privs are created by default
      * pg_read_all_settings - read all GUCs.
      * pg_read_all_stats - pg_stat_*, pg_database_size(), pg_tablespace_size()
      * pg_stat_scan_tables - may lock/scan tables
      
      Top level role - pg_monitor includes all of the above by default, plus others
      
      Author: Dave Page
      Reviewed-by: Stephen Frost, Robert Haas, Peter Eisentraut, Simon Riggs
      25fff407
    • Tom Lane's avatar
      Support \if ... \elif ... \else ... \endif in psql scripting. · e984ef58
      Tom Lane authored
      This patch adds nestable conditional blocks to psql.  The control
      structure feature per se is complete, but the boolean expressions
      understood by \if and \elif are pretty primitive; basically, after
      variable substitution and backtick expansion, the result has to be
      "true" or "false" or one of the other standard spellings of a boolean
      value.  But that's enough for many purposes, since you can always
      do the heavy lifting on the server side; and we can extend it later.
      
      Along the way, pay down some of the technical debt that had built up
      around psql/command.c:
      * Refactor exec_command() into a function per command, instead of
      being a 1500-line monstrosity.  This makes the file noticeably longer
      because of repetitive function header/trailer overhead, but it seems
      much more readable.
      * Teach psql_get_variable() and psqlscanslash.l to suppress variable
      substitution and backtick expansion on the basis of the conditional
      stack state, thereby allowing removal of the OT_NO_EVAL kluge.
      * Fix the no-doubt-once-expedient hack of sometimes silently substituting
      mainloop.c's previous_buf for query_buf when calling HandleSlashCmds.
      (It's a bit remarkable that commands like \r worked at all with that.)
      Recall of a previous query is now done explicitly in the slash commands
      where that should happen.
      
      Corey Huinker, reviewed by Fabien Coelho, further hacking by me
      
      Discussion: https://postgr.es/m/CADkLM=c94OSRTnat=LX0ivNq4pxDNeoomFfYvBKM5N_xfmLtAA@mail.gmail.com
      e984ef58
    • Andres Freund's avatar
      Try to fix xml docs build broken in 5ded4bd2. · ffae6733
      Andres Freund authored
      Apparently the sgml to xml conversion treats non-closed <para>s
      differently than jade does.
      ffae6733
    • Fujii Masao's avatar
      Simplify the example of VACUUM in documentation. · ec196930
      Fujii Masao authored
      Previously a detailed activity report by VACUUM VERBOSE ANALYZE was
      described as an example of VACUUM in docs. But it had been obsolete
      for a long time. For example, commit feb4f44d
      updated the content of that activity report in 2003, but we had
      forgotten to update the example.
      
      So basically we need to update the example. But since no one cared
      about the details of VACUUM output and complained about that mistake
      for such long time, per discussion on hackers, we decided to get rid
      of the detailed activity report from the example and simplify it.
      
      Back-patch to all supported versions.
      
      Reported by Masahiko Sawada, patch by me.
      Discussion: https://postgr.es/m/CAD21AoAGA2pB3p-CWmTkxBsbkZS1bcDGBLcYVcvcDxspG_XAfA@mail.gmail.com
      ec196930
    • Andres Freund's avatar
      Remove support for version-0 calling conventions. · 5ded4bd2
      Andres Freund authored
      The V0 convention is failure prone because we've so far assumed that a
      function is V0 if PG_FUNCTION_INFO_V1 is missing, leading to crashes
      if a function was coded against the V1 interface.  V0 doesn't allow
      proper NULL, SRF and toast handling.  V0 doesn't offer features that
      V1 doesn't.
      
      Thus remove V0 support and obsolete fmgr README contents relating to
      it.
      
      Author: Andres Freund, with contributions by Peter Eisentraut & Craig Ringer
      Reviewed-By: Peter Eisentraut, Craig Ringer
      Discussion: https://postgr.es/m/20161208213441.k3mbno4twhg2qf7g@alap3.anarazel.de
      5ded4bd2
    • Andres Freund's avatar
      Move contrib/seg to only use V1 calling conventions. · 389bb281
      Andres Freund authored
      A later commit will remove V0 support.
      
      Author: Andres Freund, with contributions by Craig Ringer
      Reviewed-By: Peter Eisentraut, Craig Ringer
      Discussion: https://postgr.es/m/20161208213441.k3mbno4twhg2qf7g@alap3.anarazel.de
      389bb281
  4. 29 Mar, 2017 12 commits
  5. 28 Mar, 2017 1 commit