1. 18 Mar, 2016 1 commit
    • Teodor Sigaev's avatar
      pg_trgm's set_limit() now uses SetConfigOption() · aa698d75
      Teodor Sigaev authored
      Deprecated set_limit() is modified to use SetConfigOption() to set
      similarity_threshold which is actually an instance of
      pg_trgm.similarity_threshold GUC variable. Previous coding directly sets
      similarity_threshold what could cause an inconsistency between states of
      actual variable and GUC representation.
      
      Per gripe from Tom Lane
      aa698d75
  2. 17 Mar, 2016 11 commits
    • Alvaro Herrera's avatar
      docs: Fix typo'd brin_summarize_new_values · 696684d8
      Alvaro Herrera authored
      I wrote "brin_summarize_new_pages" instead, in docs as well as in the
      commit message of commit ac443d10.
      
      Bug: #14030
      Reported-By: Chris Pacejo
      696684d8
    • Tom Lane's avatar
      Remove useless double calls of make_parsestate(). · bd0ab289
      Tom Lane authored
      Aleksander Alekseev
      bd0ab289
    • Robert Haas's avatar
      Update tuplesort.c comments for memory mangement improvements. · c27033ff
      Robert Haas authored
      I'm committing these changes separately so that it's clear what is
      Peter's original work versus what I changed.  This is a followup to
      commit 0011c009, and these changes
      are all by me.
      c27033ff
    • Robert Haas's avatar
      Improve memory management for external sorts. · 0011c009
      Robert Haas authored
      Introduce a new memory context which stores tuple data, and reset it
      at the end of each merge pass; this helps avoid memory fragmentation
      and, consequently, overallocation.  Also, for the final merge patch,
      eliminate memory context chunk header overhead entirely by allocating
      all of the memory used for buffering tuples during the merge in a
      single chunk.  Since this modestly increases the number of tuples we
      can store, grow the memtuples array a bit so that we're less likely to
      run short of slots there.
      
      Peter Geoghegan.  Review and testing of patches in this series by
      Jeff Janes, Greg Stark, Mithun Cy, and me.
      0011c009
    • Tom Lane's avatar
      Fix assorted breakage in to_char()'s OF format option. · 55c3a04d
      Tom Lane authored
      In HEAD, fix incorrect field width for hours part of OF when tm_gmtoff is
      negative.  This was introduced by commit 2d87eedc as a result of
      falsely applying a pattern that's correct when + signs are omitted, which
      is not the case for OF.
      
      In 9.4, fix missing abs() call that allowed a sign to be attached to the
      minutes part of OF.  This was fixed in 9.5 by 9b43d73b, but for
      inscrutable reasons not back-patched.
      
      In all three versions, ensure that the sign of tm_gmtoff is correctly
      reported even when the GMT offset is less than 1 hour.
      
      Add regression tests, which evidently we desperately need here.
      
      Thomas Munro and Tom Lane, per report from David Fetter
      55c3a04d
    • Teodor Sigaev's avatar
      Improve support of Hunspell · f4ceed6c
      Teodor Sigaev authored
      - allow to use non-ascii characters as affix flag. Non-numeric affix flags now
        are stored as string instead of numeric value of character.
      - allow to use 0 as affix flag in numeric encoded affixes
      
      That adds support for arabian, hungarian, turkish and
      brazilian portuguese languages.
      
      Author: Artur Zakirov with heavy editorization by me
      f4ceed6c
    • Robert Haas's avatar
      Fix typos. · 0218e8b3
      Robert Haas authored
      Jim Nasby
      0218e8b3
    • Peter Eisentraut's avatar
      fc201dfd
    • Peter Eisentraut's avatar
      f4c454e9
    • Tom Lane's avatar
      Fix "pg_bench -C -M prepared". · 47211af1
      Tom Lane authored
      This didn't work because when we dropped and re-established a database
      connection, we did not bother to reset session-specific state such as
      the statements-are-prepared flags.
      
      The st->prepared[] array certainly needs to be flushed, and I cleared a
      couple of other fields as well that couldn't possibly retain meaningful
      state for a new connection.
      
      In passing, fix some bogus comments and strange field order choices.
      
      Per report from Robins Tharakan.
      47211af1
    • Tom Lane's avatar
      Fix j2day() to behave sanely for negative Julian dates. · 5db51464
      Tom Lane authored
      Somebody had apparently once figured that casting to unsigned int would
      produce the right output for negative inputs, but that would only be
      true if 2^32 were a multiple of 7, which of course it ain't.  We need
      to use a signed division and then correct the sign of the remainder.
      
      AFAICT, the only case where this would arise currently is when doing
      ISO-week calculations for dates in 4714BC, where we'd compute a
      negative Julian date representing 4714-01-04BC and then do some
      arithmetic with it.  Since we don't even really document support for
      such dates, this is not of much consequence.  But we may as well
      get it right.
      
      Per report from Vitaly Burovoy.
      5db51464
  3. 16 Mar, 2016 12 commits
    • Tom Lane's avatar
      Be more careful about out-of-range dates and timestamps. · a70e13a3
      Tom Lane authored
      Tighten the semantics of boundary-case timestamptz so that we allow
      timestamps >= '4714-11-24 00:00+00 BC' and < 'ENDYEAR-01-01 00:00+00 AD'
      exactly, no more and no less, but it is allowed to enter timestamps
      within that range using non-GMT timezone offsets (which could make the
      nominal date 4714-11-23 BC or ENDYEAR-01-01 AD).  This eliminates
      dump/reload failure conditions for timestamps near the endpoints.
      To do this, separate checking of the inputs for date2j() from the
      final range check, and allow the Julian date code to handle a range
      slightly wider than the nominal range of the datatypes.
      
      Also add a bunch of checks to detect out-of-range dates and timestamps
      that formerly could be returned by operations such as date-plus-integer.
      All C-level functions that return date, timestamp, or timestamptz should
      now be proof against returning a value that doesn't pass IS_VALID_DATE()
      or IS_VALID_TIMESTAMP().
      
      Vitaly Burovoy, reviewed by Anastasia Lubennikova, and substantially
      whacked around by me
      a70e13a3
    • Robert Haas's avatar
      Another comment update. · f2b74b01
      Robert Haas authored
      I thought this was in my last commit, but I goofed.
      f2b74b01
    • Robert Haas's avatar
      Fix problems in commit c16dc1ac. · bc55cc0b
      Robert Haas authored
      Vinayak Pokale provided a patch for a copy-and-paste error in a
      comment.  I noticed that I'd use the word "automatically" nearby where
      I meant to talk about things being "atomic".  Rahila Syed spotted a
      misplaced counter update.  Fix all that stuff.
      bc55cc0b
    • Teodor Sigaev's avatar
      Add files forgotten in f576b17c · e4b523e5
      Teodor Sigaev authored
      e4b523e5
    • Teodor Sigaev's avatar
      Add word_similarity to pg_trgm contrib module. · f576b17c
      Teodor Sigaev authored
      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
    • Robert Haas's avatar
      Fix typo. · 1c4f001b
      Robert Haas authored
      Amit Langote
      1c4f001b
    • Robert Haas's avatar
      Add idle_in_transaction_session_timeout. · c6dda1f4
      Robert Haas authored
      Vik Fearing, reviewed by Stéphane Schildknecht and me, and revised
      slightly by me.
      c6dda1f4
    • Teodor Sigaev's avatar
      GUC variable pg_trgm.similarity_threshold insead of set_limit() · 5871b884
      Teodor Sigaev authored
      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
    • Peter Eisentraut's avatar
      UCS_to_EUC_JIS_2004.pl: Turn off "test" mode by default · f9e5ed61
      Peter Eisentraut authored
      It produces debugging output files that are of no further use, so we
      don't need that by default.
      f9e5ed61
    • Peter Eisentraut's avatar
      Make spacing and punctuation consistent · 9dbcb500
      Peter Eisentraut authored
      9dbcb500
    • Teodor Sigaev's avatar
      fix typo in comment · ce91b920
      Teodor Sigaev authored
      ce91b920
    • Teodor Sigaev's avatar
      Improve script generating unaccent rules · 9a206d06
      Teodor Sigaev authored
      Script now use the standard Unicode transliterator Latin-ASCII.
      
      Author: Leonard Benedetti
      9a206d06
  4. 15 Mar, 2016 8 commits
    • Robert Haas's avatar
      Fix typos. · 3aff33aa
      Robert Haas authored
      Oskari Saarenmaa
      3aff33aa
    • Stephen Frost's avatar
      Avoid incorrectly indicating exclusion constraint wait · fd658dbb
      Stephen Frost authored
      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
    • Alvaro Herrera's avatar
      Fix typos in comments · 5bcc413f
      Alvaro Herrera authored
      5bcc413f
    • Robert Haas's avatar
      postgres_fdw: make_tuple_from_result_row should set cur_attno for ctid. · 4a46a99d
      Robert Haas authored
      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
    • Robert Haas's avatar
      Fix typos. · 2a90cb69
      Robert Haas authored
      Thomas Reiss
      2a90cb69
    • Robert Haas's avatar
      Add simple VACUUM progress reporting. · c16dc1ac
      Robert Haas authored
      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
    • Tom Lane's avatar
      Cope if platform declares mbstowcs_l(), but not locale_t, in <xlocale.h>. · 0e9b8998
      Tom Lane authored
      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
    • Tom Lane's avatar
      Add a GetForeignUpperPaths callback function for FDWs. · 101fd934
      Tom Lane authored
      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
  5. 14 Mar, 2016 8 commits
    • Peter Eisentraut's avatar
      be6de4c1
    • Robert Haas's avatar
      Fix EXPLAIN ANALYZE SELECT INTO not to choose a parallel plan. · 270b7daf
      Robert Haas authored
      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
    • Tom Lane's avatar
      Provide a planner hook at a suitable place for creating upper-rel Paths. · 5864d6a4
      Tom Lane authored
      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
    • Tom Lane's avatar
      Allow callers of create_foreignscan_path to specify nondefault PathTarget. · 28048cba
      Tom Lane authored
      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
    • Tom Lane's avatar
      Rethink representation of PathTargets. · 307c7885
      Tom Lane authored
      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
    • Tom Lane's avatar
      Update PL/Perl's comment about hv_store(). · 07341a29
      Tom Lane authored
      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
    • Tom Lane's avatar
      Improve conversions from uint64 to Perl types. · f3f3aae4
      Tom Lane authored
      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
    • Robert Haas's avatar
      Update more comments for 96198d94. · 6be84eeb
      Robert Haas authored
      Etsuro Fujita, reviewed (though not completely endorsed) by Ashutosh
      Bapat, and slightly expanded by me.
      6be84eeb