1. 16 3月, 2016 15 次提交
    • T
      Add word_similarity to pg_trgm contrib module. · f576b17c
      Teodor Sigaev 提交于
      Patch introduces a concept of similarity over string and just a word from
      another string.
      
      Version of extension is not changed because 1.2 was already introduced in 9.6
      release cycle, so, there wasn't a public version.
      
      Author: Alexander Korotkov, Artur Zakirov
      f576b17c
    • R
      Fix typo. · 1c4f001b
      Robert Haas 提交于
      Amit Langote
      1c4f001b
    • R
      Add idle_in_transaction_session_timeout. · c6dda1f4
      Robert Haas 提交于
      Vik Fearing, reviewed by Stéphane Schildknecht and me, and revised
      slightly by me.
      c6dda1f4
    • T
      GUC variable pg_trgm.similarity_threshold insead of set_limit() · 5871b884
      Teodor Sigaev 提交于
      Use GUC variable pg_trgm.similarity_threshold insead of
      set_limit()/show_limit() which was introduced when defining GUC varuables
      by modules was absent.
      
      Author: Artur Zakirov
      5871b884
    • P
      UCS_to_EUC_JIS_2004.pl: Turn off "test" mode by default · f9e5ed61
      Peter Eisentraut 提交于
      It produces debugging output files that are of no further use, so we
      don't need that by default.
      f9e5ed61
    • P
      Make spacing and punctuation consistent · 9dbcb500
      Peter Eisentraut 提交于
      9dbcb500
    • T
      fix typo in comment · ce91b920
      Teodor Sigaev 提交于
      ce91b920
    • T
      Improve script generating unaccent rules · 9a206d06
      Teodor Sigaev 提交于
      Script now use the standard Unicode transliterator Latin-ASCII.
      
      Author: Leonard Benedetti
      9a206d06
    • R
      Fix typos. · 3aff33aa
      Robert Haas 提交于
      Oskari Saarenmaa
      3aff33aa
    • S
      Avoid incorrectly indicating exclusion constraint wait · fd658dbb
      Stephen Frost 提交于
      INSERT ... ON CONFLICT's precheck may have to wait on the outcome of
      another insertion, which may or may not itself be a speculative
      insertion.  This wait is not necessarily associated with an exclusion
      constraint, but was always reported that way in log messages if the wait
      happened to involve a tuple that had no speculative token.
      
      Initially discovered through use of ON CONFLICT DO NOTHING, where
      spurious references to exclusion constraints in log messages were more
      likely.
      
      Patch by Peter Geoghegan.
      Reviewed by Julien Rouhaud.
      
      Back-patch to 9.5 where INSERT ... ON CONFLICT was added.
      fd658dbb
    • A
      Fix typos in comments · 5bcc413f
      Alvaro Herrera 提交于
      5bcc413f
    • R
      postgres_fdw: make_tuple_from_result_row should set cur_attno for ctid. · 4a46a99d
      Robert Haas 提交于
      There's no reason for this function to do this for every other
      attribute number and omit it for CTID, especially since
      conversion_error_callback has code to handle that case.  This seems
      to be an oversight in commit e690b951.
      
      Etsuro Fujita
      4a46a99d
    • R
      Fix typos. · 2a90cb69
      Robert Haas 提交于
      Thomas Reiss
      2a90cb69
    • R
      Add simple VACUUM progress reporting. · c16dc1ac
      Robert Haas 提交于
      There's a lot more that could be done here yet - in particular, this
      reports only very coarse-grained information about the index vacuuming
      phase - but even as it stands, the new pg_stat_progress_vacuum can
      tell you quite a bit about what a long-running vacuum is actually
      doing.
      
      Amit Langote and Robert Haas, based on earlier work by Vinayak Pokale
      and Rahila Syed.
      c16dc1ac
    • T
      Cope if platform declares mbstowcs_l(), but not locale_t, in <xlocale.h>. · 0e9b8998
      Tom Lane 提交于
      Previously, we included <xlocale.h> only if necessary to get the definition
      of type locale_t.  According to notes in PGAC_TYPE_LOCALE_T, this is
      important because on some versions of glibc that file supplies an
      incompatible declaration of locale_t.  (This info may be obsolete, because
      on my RHEL6 box that seems to be the *only* definition of locale_t; but
      there may still be glibc's in the wild for which it's a live concern.)
      
      It turns out though that on FreeBSD and maybe other BSDen, you can get
      locale_t from stdlib.h or locale.h but mbstowcs_l() and friends only from
      <xlocale.h>.  This was leaving us compiling calls to mbstowcs_l() and
      friends with no visible prototype, which causes a warning and could
      possibly cause actual trouble, since it's not declared to return int.
      
      Hence, adjust the configure checks so that we'll include <xlocale.h>
      either if it's necessary to get type locale_t or if it's necessary to
      get a declaration of mbstowcs_l().
      
      Report and patch by Aleksander Alekseev, somewhat whacked around by me.
      Back-patch to all supported branches, since we have been using
      mbstowcs_l() since 9.1.
      0e9b8998
  2. 15 3月, 2016 12 次提交
    • T
      Add a GetForeignUpperPaths callback function for FDWs. · 101fd934
      Tom Lane 提交于
      This is basically like the just-added create_upper_paths_hook, but
      control is funneled only to the FDW responsible for all the baserels
      of the current query; so providing such a callback is much less likely
      to add useless overhead than using the hook function is.
      
      The documentation is a bit sketchy.  We'll likely want to improve it,
      and/or adjust the call conventions, when we get some experience with
      actually using this callback.  Hopefully somebody will find time to
      experiment with it before 9.6 feature freeze.
      101fd934
    • P
      Add missing include for self-containment · be6de4c1
      Peter Eisentraut 提交于
      be6de4c1
    • R
      Fix EXPLAIN ANALYZE SELECT INTO not to choose a parallel plan. · 270b7daf
      Robert Haas 提交于
      We don't support any parallel write operations at present, so choosing
      a parallel plan causes us to error out.  Also, add a new regression
      test that uses EXPLAIN ANALYZE SELECT INTO; if we'd had this previously,
      force_parallel_mode testing would have caught this issue.
      
      Mithun Cy and Robert Haas
      270b7daf
    • T
      Provide a planner hook at a suitable place for creating upper-rel Paths. · 5864d6a4
      Tom Lane 提交于
      In the initial revision of the upper-planner pathification work, the only
      available way for an FDW or custom-scan provider to inject Paths
      representing post-scan-join processing was to insert them during scan-level
      GetForeignPaths or similar processing.  While that's not impossible, it'd
      require quite a lot of duplicative processing to look forward and see if
      the extension would be capable of implementing the whole query.  To improve
      matters for custom-scan providers, provide a hook function at the point
      where the core code is about to start filling in upperrel Paths.  At this
      point Paths are available for the whole scan/join tree, which should reduce
      the amount of redundant effort considerably.
      
      (An alternative design that was suggested was to provide a separate hook
      for each post-scan-join processing step, but that seems messy and not
      clearly more useful.)
      
      Following our time-honored tradition, there's no documentation for this
      hook outside the source code.
      
      As-is, this hook is only meant for custom scan providers, which we can't
      assume very much about.  A followon patch will implement an FDW callback
      to let FDWs do the same thing in a somewhat more structured fashion.
      5864d6a4
    • T
      Allow callers of create_foreignscan_path to specify nondefault PathTarget. · 28048cba
      Tom Lane 提交于
      Although the default choice of rel->reltarget should typically be
      sufficient for scan or join paths, it's not at all sufficient for the
      purposes PathTargets were invented for; in particular not for
      upper-relation Paths.  So break API compatibility by adding a PathTarget
      argument to create_foreignscan_path().  To ease updating of existing
      code, accept a NULL value of the argument as selecting rel->reltarget.
      28048cba
    • T
      Rethink representation of PathTargets. · 307c7885
      Tom Lane 提交于
      In commit 19a54114 I did not make PathTarget a subtype of Node,
      and embedded a RelOptInfo's reltarget directly into it rather than having
      a separately-allocated Node.  In hindsight that was misguided
      micro-optimization, enabled by the fact that at that point we didn't have
      any Paths with custom PathTargets.  Now that PathTarget processing has
      been fleshed out some more, it's easier to see that it's better to have
      PathTarget as an indepedent Node type, even if it does cost us one more
      palloc to create a RelOptInfo.  So change it while we still can.
      
      This commit just changes the representation, without doing anything more
      interesting than that.
      307c7885
    • T
      Update PL/Perl's comment about hv_store(). · 07341a29
      Tom Lane 提交于
      Negative klen is documented since Perl 5.16, and 5.6 is no longer
      supported so no need to comment about it.
      
      Dagfinn Ilmari Mannsåker
      07341a29
    • T
      Improve conversions from uint64 to Perl types. · f3f3aae4
      Tom Lane 提交于
      Perl's integers are pointer-sized, so can hold more than INT_MAX on LP64
      platforms, and come in both signed (IV) and unsigned (UV).  Floating
      point values (NV) may also be larger than double.
      
      Since Perl 5.19.4 array indices are SSize_t instead of I32, so allow up
      to SSize_t_max on those versions.  The limit is not imposed just by
      av_extend's argument type, but all the array handling code, so remove
      the speculative comment.
      
      Dagfinn Ilmari Mannsåker
      f3f3aae4
    • R
      Update more comments for 96198d94. · 6be84eeb
      Robert Haas 提交于
      Etsuro Fujita, reviewed (though not completely endorsed) by Ashutosh
      Bapat, and slightly expanded by me.
      6be84eeb
    • T
      Use repalloc_huge() to enlarge a SPITupleTable's tuple pointer array. · 74a379b9
      Tom Lane 提交于
      Commit 23a27b03 widened the rows-stored counters to uint64, but
      that's academic unless we allow the tuple pointer array to exceed 1GB.
      
      (It might be a good idea to provide some other limit on how much storage
      a SPITupleTable can eat.  On the other hand, there are plenty of other
      ways to drive a backend into swap hell.)
      
      Dagfinn Ilmari Mannsåker
      74a379b9
    • R
      Improve check for overly-long extensible node name. · 3adf9ced
      Robert Haas 提交于
      The old code is bad for two reasons.  First, it has an off-by-one
      error.  Second, it won't help if you aren't running with assertions
      enabled.  Per discussion, we want a check here in that case too.
      
      Author: KaiGai Kohei, adjusted by me.
      Reviewed-by: Petr Jelinek
      Discussion: 56E0D547.1030101@2ndquadrant.com
      3adf9ced
    • T
      pg_stat_get_progress_info() should be marked STRICT. · 2da75499
      Tom Lane 提交于
      I didn't bother with a catversion bump.
      
      Report and patch by Thomas Munro
      2da75499
  3. 14 3月, 2016 4 次提交
    • T
      Teach the configure script to validate its --with-pgport argument. · bf53d5c2
      Tom Lane 提交于
      Previously, configure would take any string, including an empty string,
      leading to obscure compile failures in guc.c.  It seems worth expending
      a few lines of code to ensure that the argument is a decimal number
      between 1 and 65535.
      
      Report and patch by Jim Nasby; reviews by Alex Shulgin, Peter Eisentraut,
      Ivan Kartyshov
      bf53d5c2
    • T
      Mop-up for setting minimum Tcl version to 8.4. · 9da70efc
      Tom Lane 提交于
      Commit e2609323 set the minimum Tcl version we support to 8.4, but
      I forgot to adjust the documentation to say the same.  Some nosing
      around for other consequences found that the configure script could
      be simplified slightly as well.
      9da70efc
    • T
      Fix memory leak in repeated GIN index searches. · ab4ff288
      Tom Lane 提交于
      Commit d88976cf removed this code from ginFreeScanKeys():
      -		if (entry->list)
      -			pfree(entry->list);
      evidently in the belief that that ItemPointer array is allocated in the
      keyCtx and so would be reclaimed by the following MemoryContextReset.
      Unfortunately, it isn't and it won't.  It'd likely be a good idea for
      that to become so, but as a simple and back-patchable fix in the
      meantime, restore this code to ginFreeScanKeys().
      
      Also, add a similar pfree to where startScanEntry() is about to zero out
      entry->list.  I am not sure if there are any code paths where this
      change prevents a leak today, but it seems like cheap future-proofing.
      
      In passing, make the initial allocation of so->entries[] use palloc
      not palloc0.  The code doesn't depend on unused entries being zero;
      if it did, the array-enlargement code in ginFillScanEntry() would be
      wrong.  So using palloc0 initially can only serve to confuse readers
      about what the invariant is.
      
      Per report from Felipe de Jesús Molina Bravo, via Jaime Casanova in
      <CAJGNTeMR1ndMU2Thpr8GPDUfiHTV7idELJRFusA5UXUGY1y-eA@mail.gmail.com>
      ab4ff288
    • P
      96adb14d
  4. 13 3月, 2016 8 次提交
    • M
      Rename auto_explain.sample_ratio to sample_rate · 7a8d8748
      Magnus Hagander 提交于
      Per suggestion from Tomas Vondra
      
      Author: Julien Rouhaud
      7a8d8748
    • M
      Fix order of MemSet arguments · a1aa8b7e
      Magnus Hagander 提交于
      Noted by Tomas Vondra
      a1aa8b7e
    • T
      Report memory context stats upon out-of-memory in repalloc[_huge]. · 4b980167
      Tom Lane 提交于
      This longstanding functionality evidently got lost in commit
      3d6d1b58.  Noted while studying an OOM report from Jaime
      Casanova.  Backpatch to 9.5 where the bug was introduced.
      4b980167
    • T
      Fix Windows portability issue in 23a27b03. · ab737f6b
      Tom Lane 提交于
      _strtoui64() is available in MSVC builds, but apparently not with
      other Windows toolchains.  Thanks to Petr Jelinek for the diagnosis.
      ab737f6b
    • T
      Get rid of scribbling on a const variable in psql's print.c. · fc7a9dfd
      Tom Lane 提交于
      Commit a2dabf0e had the bright idea that it could modify a "const"
      global variable if it merely casted away const from a pointer.  This does
      not work on platforms where the compiler puts "const" variables into
      read-only storage.  Depressingly, we evidently have no such platforms in
      our buildfarm ... an oversight I have now remedied.  (The one platform
      that is known to catch this is recent OS X with -fno-common.)
      
      Per report from Chris Ruprecht.  Back-patch to 9.5 where the bogus
      code was introduced.
      fc7a9dfd
    • T
      Widen query numbers-of-tuples-processed counters to uint64. · 23a27b03
      Tom Lane 提交于
      This patch widens SPI_processed, EState's es_processed field, PortalData's
      portalPos field, FuncCallContext's call_cntr and max_calls fields,
      ExecutorRun's count argument, PortalRunFetch's result, and the max number
      of rows in a SPITupleTable to uint64, and deals with (I hope) all the
      ensuing fallout.  Some of these values were declared uint32 before, and
      others "long".
      
      I also removed PortalData's posOverflow field, since that logic seems
      pretty useless given that portalPos is now always 64 bits.
      
      The user-visible results are that command tags for SELECT etc will
      correctly report tuple counts larger than 4G, as will plpgsql's GET
      GET DIAGNOSTICS ... ROW_COUNT command.  Queries processing more tuples
      than that are still not exactly the norm, but they're becoming more
      common.
      
      Most values associated with FETCH/MOVE distances, such as PortalRun's count
      argument and the count argument of most SPI functions that have one, remain
      declared as "long".  It's not clear whether it would be worth promoting
      those to int64; but it would definitely be a large dollop of additional
      API churn on top of this, and it would only help 32-bit platforms which
      seem relatively less likely to see any benefit.
      
      Andreas Scherbaum, reviewed by Christian Ullrich, additional hacking by me
      23a27b03
    • A
      Include portability/mem.h into fd.c for MAP_FAILED. · e0115750
      Andres Freund 提交于
      Buildfarm members gaur and pademelon are old enough not to know about
      MAP_FAILED; which is used in 428b1d6b. Include portability/mem.h to fix;
      as already done in a bunch of other places.
      e0115750
    • T
      Re-export a few of createplan.c's make_xxx() functions. · 570be1f7
      Tom Lane 提交于
      CitusDB is using these and don't wish to redesign their code right now.
      I am not on board with this being a good idea, or a good precedent,
      but I lack the energy to fight about it.
      570be1f7
  5. 12 3月, 2016 1 次提交
    • R
      pg_upgrade: Convert old visibility map format to new format. · 7087166a
      Robert Haas 提交于
      Commit a892234f added a second bit per
      page to the visibility map, but pg_upgrade has been unaware of it up
      until now.  Therefore, a pg_upgrade from an earlier major release of
      PostgreSQL to any commit preceding this one and following the one
      mentioned above would result in invalid visibility map contents on the
      new cluster, very possibly leading to data corruption.  This plugs
      that hole.
      
      Masahiko Sawada, reviewed by Jeff Janes, Bruce Momjian, Simon Riggs,
      Michael Paquier, Andres Freund, me, and others.
      7087166a