1. 11 Apr, 2017 8 commits
    • Tom Lane's avatar
      Handle restriction clause lists more uniformly in postgres_fdw. · 28b04787
      Tom Lane authored
      Clauses in the lists retained by postgres_fdw during planning were
      sometimes bare boolean clauses, sometimes RestrictInfos, and sometimes
      a mixture of the two in the same list.  The comment about that situation
      didn't come close to telling the full truth, either.  Aside from being
      confusing, this had a couple of bad practical consequences:
      * waste of planning cycles due to inability to cache per-clause selectivity
      and cost estimates;
      * sometimes, RestrictInfos would sneak into the fdw_private list of a
      finished Plan node, causing failures if, for example, we tried to ship
      the Plan tree to a parallel worker.
      (It may well be that it's a bug in the parallel-query logic that we
      would ever try to ship such a plan to a parallel worker, but in any
      case this deserves to be cleaned up.)
      
      To fix, rearrange so that clause lists in PgFdwRelationInfo are always
      lists of RestrictInfos, and then strip the RestrictInfos at the last
      minute when making a Plan node.  In passing do a bit of refactoring and
      comment cleanup in postgresGetForeignPlan and foreign_join_ok.
      
      Although the messiness here dates back at least to 9.6, there's no evidence
      that it causes anything worse than wasted planning cycles in 9.6, so no
      back-patch for now.
      
      Per fuzz testing by Andreas Seltenreich.
      
      Tom Lane and Ashutosh Bapat
      
      Discussion: https://postgr.es/m/87tw5x4vcu.fsf@credativ.de
      28b04787
    • Fujii Masao's avatar
      Add max_sync_workers_per_subscription to postgresql.conf.sample. · ff7bce17
      Fujii Masao authored
      This commit also does
      
      - add REPLICATION_SUBSCRIBERS into config_group
      - mark max_logical_replication_workers and max_sync_workers_per_subscription
        as REPLICATION_SUBSCRIBERS parameters
      - move those parameters into "Subscribers" section in postgresql.conf.sample
      
      Author: Masahiko Sawada, Petr Jelinek and me
      Reported-by: Masahiko Sawada
      Discussion: http://postgr.es/m/CAD21AoAonSCoa=v=87ZO3vhfUZA1k_E2XRNHTt=xioWGUa+0ug@mail.gmail.com
      ff7bce17
    • Bruce Momjian's avatar
      docs: Improve window function docs · 1c1a4726
      Bruce Momjian authored
      Specifically, the behavior of general-purpose and statistical aggregates
      as window functions was not clearly documented, and terms were
      inconsistently used.  Also add docs about the difference between
      cume_dist and percent_rank, rather than just the formulas.
      
      Discussion: 20170406214918.GA5757@momjian.us
      1c1a4726
    • Magnus Hagander's avatar
      Remove symbol WIN32_ONLY_COMPILER · a4777f35
      Magnus Hagander authored
      This used to mean "Visual C++ except in those parts where Borland C++
      was supported where it meant one of those". Now that we don't support
      Borland C++ anymore, simplify by using _MSC_VER which is the normal way
      to detect Visual C++.
      a4777f35
    • Magnus Hagander's avatar
      Remove support for bcc and msvc standalone libpq builds · 6da56f3f
      Magnus Hagander authored
      This removes the support for building just libpq using Borland C++ or
      Visual C++. This has not worked properly for years, and given the number
      of complaints it's clearly not worth the maintenance burden.
      
      Building libpq using the standard MSVC build system is of course still
      supported, along with mingw.
      6da56f3f
    • Robert Haas's avatar
      Fix possibile deadlock when dropping partitions. · 258cef12
      Robert Haas authored
      heap_drop_with_catalog and RangeVarCallbackForDropRelation should
      lock the parent before locking the target relation.
      
      Amit Langote
      
      Discussion: http://postgr.es/m/29588799-a8ce-b0a2-3dae-f39ff6d35922@lab.ntt.co.jp
      258cef12
    • Tom Lane's avatar
      Fix pgbench's --progress-timestamp option to print Unix-epoch timestamps. · feffa0e0
      Tom Lane authored
      As a consequence of commit 1d63f7d2, on platforms with CLOCK_MONOTONIC,
      you got some random timescale or other instead of standard Unix timestamps
      as expected.  I'd attempted to fix pgbench for that change in commits
      74baa1e3 and 67a87535, but missed this place.  Fix in the same way as
      those previous commits, ie, just eat the cost of an extra gettimeofday();
      one extra syscall per progress report isn't worth sweating over.  Per
      report from Jeff Janes.
      
      In passing, use snprintf not sprintf for this purpose.  I don't think
      there's any chance of actual buffer overrun, but it just looks safer.
      
      Discussion: https://postgr.es/m/CAMkU=1zrQaPwBN+NcBd3pWCb=vWaiL=mmWfJjDJjh-a7eVr-Og@mail.gmail.com
      feffa0e0
    • Michael Meskes's avatar
      Document that bytea is best represented as char * in C for ecpg. · a6940bdc
      Michael Meskes authored
      Patch by Kato, Sho <kato-sho@jp.fujitsu.com>
      a6940bdc
  2. 10 Apr, 2017 11 commits
  3. 09 Apr, 2017 2 commits
  4. 08 Apr, 2017 7 commits
    • Tom Lane's avatar
      Clean up bugs in clause_selectivity() cleanup. · eef8c006
      Tom Lane authored
      Commit ac2b0950 was not terribly carefully reviewed.  Band-aid it to
      not fail on non-RestrictInfo input, per report from Andreas Seltenreich.
      Also make it do something more reasonable with variable-free clauses,
      and improve nearby comments.
      
      Discussion: https://postgr.es/m/87inmf5rdx.fsf@credativ.de
      eef8c006
    • Tom Lane's avatar
      Add newly-symlinked files to "make clean" target. · aba696d1
      Tom Lane authored
      Oversight in 60f11b87.
      aba696d1
    • Heikki Linnakangas's avatar
      Fix the new SASLprep tests to work with non-UTF-8 locales. · 9025af3e
      Heikki Linnakangas authored
      Fix by forcing database encoding to UTF-8, regardless of the current
      locale.
      
      Pointed out by Tom Lane.
      
      Discussion: https://www.postgresql.org/message-id/8934.1491614631@sss.pgh.pa.us
      9025af3e
    • Peter Eisentraut's avatar
      doc: Add some markup · f0e44021
      Peter Eisentraut authored
      f0e44021
    • Kevin Grittner's avatar
      Add GUCs for predicate lock promotion thresholds. · c63172d6
      Kevin Grittner authored
      Defaults match the fixed behavior of prior releases, but now DBAs
      have better options to tune serializable workloads.
      
      It might be nice to be able to set this per relation, but that part
      will need to wait for another release.
      
      Author: Dagfinn Ilmari Mannsåker
      c63172d6
    • Tom Lane's avatar
      Optimize joins when the inner relation can be proven unique. · 9c7f5229
      Tom Lane authored
      If there can certainly be no more than one matching inner row for a given
      outer row, then the executor can move on to the next outer row as soon as
      it's found one match; there's no need to continue scanning the inner
      relation for this outer row.  This saves useless scanning in nestloop
      and hash joins.  In merge joins, it offers the opportunity to skip
      mark/restore processing, because we know we have not advanced past the
      first possible match for the next outer row.
      
      Of course, the devil is in the details: the proof of uniqueness must
      depend only on joinquals (not otherquals), and if we want to skip
      mergejoin mark/restore then it must depend only on merge clauses.
      To avoid adding more planning overhead than absolutely necessary,
      the present patch errs in the conservative direction: there are cases
      where inner_unique or skip_mark_restore processing could be used, but
      it will not do so because it's not sure that the uniqueness proof
      depended only on "safe" clauses.  This could be improved later.
      
      David Rowley, reviewed and rather heavily editorialized on by me
      
      Discussion: https://postgr.es/m/CAApHDvqF6Sw-TK98bW48TdtFJ+3a7D2mFyZ7++=D-RyPsL76gw@mail.gmail.com
      9c7f5229
    • Andres Freund's avatar
      Fix issues in e8fdbd58. · f13a9121
      Andres Freund authored
      When the 64bit atomics simulation is in use, we can't necessarily
      guarantee the correct alignment of the atomics due to lack of compiler
      support for doing so- that's fine from a safety perspective, because
      everything is protected by a lock, but we asserted the alignment in
      all cases.  Weaken them.  Per complaint from Alvaro Herrera.
      
      My #ifdefery for PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY wasn't
      sufficient. Fix that.  Per complaint from Alexander Korotkov.
      f13a9121
  5. 07 Apr, 2017 12 commits