1. 04 Apr, 2017 14 commits
  2. 03 Apr, 2017 5 commits
  3. 02 Apr, 2017 6 commits
  4. 01 Apr, 2017 14 commits
    • Kevin Grittner's avatar
      Fix two undocumented parameters to functions from ENR patch. · 41bd155d
      Kevin Grittner authored
      On ProcessUtility document the parameter, to match others.
      
      On CreateCachedPlan drop the queryEnv parameter.  It was not
      referenced within the function, and had been added on the
      assumption that with some unknown future usage of QueryEnvironment
      it might be useful to do something there.  We have avoided other
      "just in case" implementation of unused paramters, so drop it here.
      
      Per gripe from Tom Lane
      41bd155d
    • Alvaro Herrera's avatar
      BRIN de-summarization · c655899b
      Alvaro Herrera authored
      When the BRIN summary tuple for a page range becomes too "wide" for the
      values actually stored in the table (because the tuples that were
      present originally are no longer present due to updates or deletes), it
      can be useful to remove the outdated summary tuple, so that a future
      summarization can install a tighter summary.
      
      This commit introduces a SQL-callable interface to do so.
      
      Author: Álvaro Herrera
      Reviewed-by: Eiji Seki
      Discussion: https://postgr.es/m/20170228045643.n2ri74ara4fhhfxf@alvherre.pgsql
      c655899b
    • Alvaro Herrera's avatar
      Fix expected output · 3a82129a
      Alvaro Herrera authored
      Previous commit had a thinko in the expected output for new tests.
      
      Per buildfarm
      3a82129a
    • 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
  5. 31 Mar, 2017 1 commit
    • Tom Lane's avatar
      For foreign keys, check REFERENCES privilege only on the referenced table. · 64d4da51
      Tom Lane authored
      We were requiring that the user have REFERENCES permission on both the
      referenced and referencing tables --- but this doesn't seem to have any
      support in the SQL standard, which says only that you need REFERENCES
      permission on the referenced table.  And ALTER TABLE ADD FOREIGN KEY has
      already checked that you own the referencing table, so the check could
      only fail if a table owner has revoked his own REFERENCES permission.
      Moreover, the symmetric interpretation of this permission is unintuitive
      and confusing, as per complaint from Paul Jungwirth.  So let's drop the
      referencing-side check.
      
      In passing, do a bit of wordsmithing on the GRANT reference page so that
      all the privilege types are described in similar fashion.
      
      Discussion: https://postgr.es/m/8940.1490906755@sss.pgh.pa.us
      64d4da51