1. 21 Jan, 2018 1 commit
    • Bruce Momjian's avatar
      doc: update intermediate certificate instructions · 815f84aa
      Bruce Momjian authored
      Document how to properly create root and intermediate certificates using
      v3_ca extensions and where to place intermediate certificates so they
      are properly transferred to the remote side with the leaf certificate to
      link to the remote root certificate.  This corrects docs that used to
      say that intermediate certificates must be stored with the root
      certificate.
      
      Also add instructions on how to create root, intermediate, and leaf
      certificates.
      
      Discussion: https://postgr.es/m/20180116002238.GC12724@momjian.us
      
      Reviewed-by: Michael Paquier
      
      Backpatch-through: 9.3
      815f84aa
  2. 20 Jan, 2018 2 commits
  3. 19 Jan, 2018 12 commits
  4. 18 Jan, 2018 4 commits
  5. 17 Jan, 2018 6 commits
    • Bruce Momjian's avatar
      Reorder C includes · f033462d
      Bruce Momjian authored
      Reorder header files in joinrels.c and pathnode.c in alphabetical order,
      removing unnecessary ones.
      
      Author: Etsuro Fujita
      f033462d
    • Robert Haas's avatar
      postgres_fdw: Avoid 'outer pathkeys do not match mergeclauses' error. · 4bbf6edf
      Robert Haas authored
      When pushing down a join to a foreign server, postgres_fdw constructs
      an alternative plan to be used for any EvalPlanQual rechecks that
      prove to be necessary.  This plan is stored as the outer subplan of
      the Foreign Scan implementing the pushed-down join.  Previously, this
      alternative plan could have a different nominal sort ordering than its
      parent, which seemed OK since there will only be one tuple per base
      table anyway in the case of an EvalPlanQual recheck.  Actually,
      though, it caused a problem if that path was used as a building block
      for the EvalPlanQual recheck plan of a higher-level foreign join,
      because we could end up with a merge join one of whose inputs was not
      labelled with the correct sort order.  Repair by injecting an extra
      Sort node into the EvalPlanQual recheck plan whenever it would
      otherwise fail to be sorted at least as well as its parent Foreign
      Scan.
      
      Report by Jeff Janes.  Patch by me, reviewed by Tom Lane, who also
      provided the test case and comment text.
      
      Discussion: http://postgr.es/m/CAMkU=1y2G8VOVBHv3iXU2TMAj7-RyBFFW1uhkr5sm9LQ2=X35g@mail.gmail.com
      4bbf6edf
    • Tom Lane's avatar
      Remove useless lookup of root partitioned rel in ExecInitModifyTable(). · dca48d14
      Tom Lane authored
      node->partitioned_rels is only set in UPDATE/DELETE cases, but
      ExecInitModifyTable only uses its "rel" variable in INSERT cases,
      so the extra logic to find the root rel is just a waste of complexity
      and cycles.
      
      Etsuro Fujita, reviewed by Amit Langote
      
      Discussion: https://postgr.es/m/93cf9816-2f7d-0f67-8ed2-4a4e497a6ab8@lab.ntt.co.jp
      dca48d14
    • Simon Riggs's avatar
      Ability to advance replication slots · 9c7d06d6
      Simon Riggs authored
      Ability to advance both physical and logical replication slots using a
      new user function pg_replication_slot_advance().
      
      For logical advance that means records are consumed as fast as possible
      and changes are not given to output plugin for sending. Makes 2nd phase
      (after we reached SNAPBUILD_FULL_SNAPSHOT) of replication slot creation
      faster, especially when there are big transactions as the reorder buffer
      does not have to deal with data changes and does not have to spill to
      disk.
      
      Author: Petr Jelinek
      Reviewed-by: Simon Riggs
      9c7d06d6
    • Andrew Dunstan's avatar
      585e166e
    • Andrew Dunstan's avatar
      Centralize json and jsonb handling of datetime types · cc4feded
      Andrew Dunstan authored
      The creates a single function JsonEncodeDateTime which will format these
      data types in an efficient and consistent manner. This will be all the
      more important when we come to jsonpath so we don't have to implement yet
      more code doing the same thing in two more places.
      
      This also extends the code to handle time and timetz types which were
      not previously handled specially. This requires exposing the time2tm and
      timetz2tm functions.
      
      Patch from Nikita Glukhov
      cc4feded
  6. 16 Jan, 2018 1 commit
  7. 13 Jan, 2018 1 commit
  8. 12 Jan, 2018 7 commits
    • Bruce Momjian's avatar
      docs: replace dblink() mention with foreign data mention · 255f1418
      Bruce Momjian authored
      Reported-by: steven.winfield@cantabcapital.com
      
      Discussion: https://postgr.es/m/20171031105039.17183.850@wrigleys.postgresql.org
      255f1418
    • Tom Lane's avatar
      Fix postgres_fdw to cope with duplicate GROUP BY entries. · e9f2703a
      Tom Lane authored
      Commit 7012b132, which added the ability to push down aggregates and
      grouping to the remote server, wasn't careful to ensure that the remote
      server would have the same idea we do about which columns are the grouping
      columns, in cases where there are textually identical GROUP BY expressions.
      Such cases typically led to "targetlist item has multiple sortgroupref
      labels" errors.
      
      To fix this reliably, switch over to using "GROUP BY column-number" syntax
      rather than "GROUP BY expression" in transmitted queries, and adjust
      foreign_grouping_ok() to be more careful about duplicating the sortgroupref
      labeling of the local pathtarget.
      
      Per bug #14890 from Sean Johnston.  Back-patch to v10 where the buggy code
      was introduced.
      
      Jeevan Chalke, reviewed by Ashutosh Bapat
      
      Discussion: https://postgr.es/m/20171107134948.1508.94783@wrigleys.postgresql.org
      e9f2703a
    • Tom Lane's avatar
      Avoid unnecessary failure in SELECT concurrent with ALTER NO INHERIT. · 680d5405
      Tom Lane authored
      If a query against an inheritance tree runs concurrently with an ALTER
      TABLE that's disinheriting one of the tree members, it's possible to get
      a "could not find inherited attribute" error because after obtaining lock
      on the removed member, make_inh_translation_list sees that its columns
      have attinhcount=0 and decides they aren't the columns it's looking for.
      
      An ideal fix, perhaps, would avoid including such a just-removed member
      table in the query at all; but there seems no way to accomplish that
      without adding expensive catalog rechecks or creating a likelihood of
      deadlocks.  Instead, let's just drop the check on attinhcount.  In this
      way, a query that's included a just-disinherited child will still
      succeed, which is not a completely unreasonable behavior.
      
      This problem has existed for a long time, so back-patch to all supported
      branches.  Also add an isolation test verifying related behaviors.
      
      Patch by me; the new isolation test is based on Kyotaro Horiguchi's work.
      
      Discussion: https://postgr.es/m/20170626.174612.23936762.horiguchi.kyotaro@lab.ntt.co.jp
      680d5405
    • Tom Lane's avatar
      Fix incorrect handling of subquery pullup in the presence of grouping sets. · 90947674
      Tom Lane authored
      If we flatten a subquery whose target list contains constants or
      expressions, when those output columns are used in GROUPING SET columns,
      the planner was capable of doing the wrong thing by merging a pulled-up
      expression into the surrounding expression during const-simplification.
      Then the late processing that attempts to match subexpressions to grouping
      sets would fail to match those subexpressions to grouping sets, with the
      effect that they'd not go to null when expected.
      
      To fix, wrap such subquery outputs in PlaceHolderVars, ensuring that
      they preserve their separate identity throughout the planner's expression
      processing.  This is a bit of a band-aid, because the wrapper defeats
      const-simplification even in places where it would be safe to allow.
      But a nicer fix would likely be too invasive to back-patch, and the
      consequences of the missed optimizations probably aren't large in most
      cases.
      
      Back-patch to 9.5 where grouping sets were introduced.
      
      Heikki Linnakangas, with small mods and better test cases by me;
      additional review by Andrew Gierth
      
      Discussion: https://postgr.es/m/7dbdcf5c-b5a6-ef89-4958-da212fe10176@iki.fi
      90947674
    • Michael Meskes's avatar
      Fix parsing of compatibility mode argument. · ca4587f3
      Michael Meskes authored
      Patch by Ashutosh Sharma <ashu.coek88@gmail.com>
      ca4587f3
    • Alvaro Herrera's avatar
      Remove hard-coded schema knowledge about pg_attribute from genbki.pl · 49c784ec
      Alvaro Herrera authored
      Add the ability to label a column's default value in the catalog header,
      and implement this for pg_attribute.  A new function in Catalog.pm is
      used to fill in a tuple with defaults.  The build process will complain
      loudly if a catalog entry is incomplete,
      
      Commit 8137f2c3 labeled variable length columns for the C preprocessor.
      Expose that label to genbki.pl so we can exclude those columns from schema
      macros in a general fashion. Also, format schema macro entries according
      to their types.
      
      This means slightly less code maintenance, but more importantly it's a
      proving ground for mechanisms intended to be used in later commits.
      
      While at it, I (Álvaro) couldn't resist making some changes in
      genbki.pl: rename some functions to actually indicate their purpose
      instead of actively misleading onlookers; and don't iterate on the whole
      of pg_type to find the entry for each catalog row, using a hash instead
      of an array.
      
      Author: John Naylor, some changes by Álvaro Herrera
      Discussion: https://postgr.es/m/CAJVSVGVJHwD8sfDfZW9TbCHWKf=C1YDRM-rF=2JenRU_y+VcFg@mail.gmail.com
      49c784ec
    • Bruce Momjian's avatar
      C comment: fix "the the" mentions in C comments · bdb70c12
      Bruce Momjian authored
      Reported-by: Christoph Dreis
      
      Discussion: https://postgr.es/m/007e01d3519e$2734ca10$759e5e30$@freenet.de
      
      Author: Christoph Dreis
      bdb70c12
  9. 11 Jan, 2018 6 commits