1. 31 Mar, 2016 1 commit
  2. 30 Mar, 2016 13 commits
    • Alvaro Herrera's avatar
      I forgot the alternate expected file in previous commit · 3a3b3090
      Alvaro Herrera authored
      Without this, the test_slot_timelines modules fails "make installcheck"
      because the required feature is not enabled in a stock server.
      
      Per buildfarm
      3a3b3090
    • Alvaro Herrera's avatar
      Enable logical slots to follow timeline switches · 24c5f1a1
      Alvaro Herrera authored
      When decoding from a logical slot, it's necessary for xlog reading to be
      able to read xlog from historical (i.e. not current) timelines;
      otherwise, decoding fails after failover, because the archives are in
      the historical timeline.  This is required to make "failover logical
      slots" possible; it currently has no other use, although theoretically
      it could be used by an extension that creates a slot on a standby and
      continues to replay from the slot when the standby is promoted.
      
      This commit includes a module in src/test/modules with functions to
      manipulate the slots (which is not otherwise possible in SQL code) in
      order to enable testing, and a new test in src/test/recovery to ensure
      that the behavior is as expected.
      
      Author: Craig Ringer
      Reviewed-By: Oleksii Kliukin, Andres Freund, Petr Jelínek
      24c5f1a1
    • Alvaro Herrera's avatar
      XLogReader general code cleanup · 3b02ea4f
      Alvaro Herrera authored
      Some minor tweaks and comment additions, for cleanliness sake and to
      avoid having the upcoming timeline-following patch be polluted with
      unrelated cleanup.
      
      Extracted from a larger patch by Craig Ringer, reviewed by Andres
      Freund, with some additions by myself.
      3b02ea4f
    • Tom Lane's avatar
      Improve portability of I/O behavior for the geometric types. · 50861cd6
      Tom Lane authored
      Formerly, the geometric I/O routines such as box_in and point_out relied
      directly on strtod() and sprintf() for conversion of the float8 component
      values of their data types.  However, the behavior of those functions is
      pretty platform-dependent, especially for edge-case values such as
      infinities and NaNs.  This was exposed by commit acdf2a8b, which
      added test cases involving boxes with infinity endpoints, and immediately
      failed on Windows and AIX buildfarm members.  We solved these problems
      years ago in the main float8in and float8out functions, so let's fix it
      by making the geometric types use that code instead of depending directly
      on the platform-supplied functions.
      
      To do this, refactor the float8in code so that it can be used to parse
      just part of a string, and as a convenience make the guts of float8out
      usable without going through DirectFunctionCall.
      
      While at it, get rid of geo_ops.c's fairly shaky assumptions about the
      maximum output string length for a double, by having it build results in
      StringInfo buffers instead of fixed-length strings.
      
      In passing, convert all the "invalid input syntax for type foo" messages
      in this area of the code into "invalid input syntax for type %s" to reduce
      the number of distinct translatable strings, per recent discussion.
      We would have needed a fair number of the latter anyway for code-sharing
      reasons, so we might as well just go whole hog.
      
      Note: this patch is by no means intended to guarantee that the geometric
      types uniformly behave sanely for infinity or NaN component values.
      But any bugs we have in that line were there all along, they were just
      harder to reach in a platform-independent way.
      50861cd6
    • Tom Lane's avatar
      Suppress uninitialized-variable warnings. · 818e5937
      Tom Lane authored
      My compiler doesn't like the lack of initialization of "flag", and
      I think it's right: if there were zero keys we'd have an undefined
      result.  The AND of zero items is TRUE, so initialize to TRUE.
      818e5937
    • Teodor Sigaev's avatar
      Bump catalog version, forget in acdf2a8b · 2d02a856
      Teodor Sigaev authored
      2d02a856
    • Teodor Sigaev's avatar
      Introduce SP-GiST operator class over box. · acdf2a8b
      Teodor Sigaev authored
      Patch implements quad-tree over boxes, naive approach of 2D quad tree will not
      work for any non-point objects because splitting space on node is not
      efficient. The idea of pathc is treating 2D boxes as 4D points, so,
      object will not overlap (in 4D space).
      
      The performance tests reveal that this technique especially beneficial
      with too much overlapping objects, so called "spaghetti data".
      
      Author: Alexander Lebedev with editorization by Emre Hasegeli and me
      acdf2a8b
    • Teodor Sigaev's avatar
      Use traversalValue in SP-GiST range opclass. · 87545f54
      Teodor Sigaev authored
      Author: Alexander Lebedev
      87545f54
    • Teodor Sigaev's avatar
      Introduce traversalValue for SP-GiST scan · ccd6eb49
      Teodor Sigaev authored
      During scan sometimes it would be very helpful to know some information about
      parent node or all 	ancestor nodes. Right now reconstructedValue could be used
      but it's not a right usage of it (range opclass uses that).
      
      traversalValue is arbitrary piece of memory in separate MemoryContext while
      reconstructedVale should have the same type as indexed column.
      
      Subsequent patches for range opclass and quad4d tree will use it.
      
      Author: Alexander Lebedev, Teodor Sigaev
      ccd6eb49
    • Magnus Hagander's avatar
      Add missing gss option to msvc config template · 3063e7a8
      Magnus Hagander authored
      Michael Paquier
      3063e7a8
    • Tom Lane's avatar
      Remove just-added tests for to_timestamp(float8) with out-of-range inputs. · c53ab8a3
      Tom Lane authored
      Reporting the specific out-of-range input value produces platform-dependent
      results.  We could skip reporting the value, but that's contrary to our
      message style guidelines and unhelpful to users.  Or we could add a
      separate expected-output file for Windows, but that would be a substantial
      maintenance burden, and these test cases seem unlikely to be worth it.
      
      Per buildfarm.
      c53ab8a3
    • Tom Lane's avatar
      Remove TZ environment-variable entry from postgres reference page. · c3834ef9
      Tom Lane authored
      The server hasn't paid attention to the TZ environment variable since
      commit ca4af308, but that commit missed removing this documentation
      reference, as did commit d883b916 which added the reference where
      it now belongs (initdb).
      
      Back-patch to 9.2 where the behavior changed.  Also back-patch
      d883b916 as needed.
      
      Matthew Somerville
      c3834ef9
    • Robert Haas's avatar
      Add new replication mode synchronous_commit = 'remote_apply'. · 314cbfc5
      Robert Haas authored
      In this mode, the master waits for the transaction to be applied on
      the remote side, not just written to disk.  That means that you can
      count on a transaction started on the standby to see all commits
      previously acknowledged by the master.
      
      To make this work, the standby sends a reply after replaying each
      commit record generated with synchronous_commit >= 'remote_apply'.
      This introduces a small inefficiency: the extra replies will be sent
      even by standbys that aren't the current synchronous standby.  But
      previously-existing synchronous_commit levels make no attempt at all
      to optimize which replies are sent based on what the primary cares
      about, so this is no worse, and at least avoids any extra replies for
      people not using the feature at all.
      
      Thomas Munro, reviewed by Michael Paquier and by me.  Some additional
      tweaks by me.
      314cbfc5
  3. 29 Mar, 2016 18 commits
    • Tom Lane's avatar
      Fix interval_mul() to not produce insane results. · a898b409
      Tom Lane authored
      interval_mul() attempts to prevent its calculations from producing silly
      results, but it forgot that zero times infinity yields NaN in IEEE
      arithmetic.  Hence, a case like '1 second'::interval * 'infinity'::float8
      produced a NaN for the months product, which didn't trigger the range
      check, resulting in bogus and possibly platform-dependent output.
      
      This isn't terribly obvious to the naked eye because if you try that
      exact case, you get "interval out of range" which is what you expect
      --- but if you look closer, the error is coming from interval_out not
      interval_mul.  interval_mul has allowed a bogus value into the system.
      
      Fix by adding isnan tests.
      
      Noted while testing Vitaly Burovoy's fix for infinity input to
      to_timestamp().  Given the lack of field complaints, I doubt this
      is worth a back-patch.
      a898b409
    • Tom Lane's avatar
      Allow to_timestamp(float8) to convert float infinity to timestamp infinity. · e511d878
      Tom Lane authored
      With the original SQL-function implementation, such cases failed because
      we don't support infinite intervals.  Converting the function to C lets
      us bypass the interval representation, which should be a bit faster as
      well as more flexible.
      
      Vitaly Burovoy, reviewed by Anastasia Lubennikova
      e511d878
    • Robert Haas's avatar
      Fix bug in aggregate (de)serialization commit. · 96f8373c
      Robert Haas authored
      resulttypeLen and resulttypeByVal must be set correctly when serializing
      aggregates, not just when finalizing them.  This was in David's final
      patch but I downloaded the wrong version by mistake and failed to spot
      the error.
      
      David Rowley
      96f8373c
    • Robert Haas's avatar
      Allow aggregate transition states to be serialized and deserialized. · 5fe5a2ce
      Robert Haas authored
      This is necessary infrastructure for supporting parallel aggregation
      for aggregates whose transition type is "internal".  Such values
      can't be passed between cooperating processes, because they are
      just pointers.
      
      David Rowley, reviewed by Tomas Vondra and by me.
      5fe5a2ce
    • Robert Haas's avatar
      Improve pgbench docs regarding per-transaction logging. · 7f0a2c85
      Robert Haas authored
      The old documentation didn't know about the new -b flag, only about -f.
      
      Fabien Coelho
      7f0a2c85
    • Robert Haas's avatar
      Fix pgbench documentation error. · d797bf7d
      Robert Haas authored
      The description of what the per-transaction log file says for skipped
      transactions is just plain wrong.
      
      Report and patch by Tomas Vondra, reviewed by Fabien Coelho and
      modified by me.
      d797bf7d
    • Alvaro Herrera's avatar
      pgbench: allow a script weight of zero · a1c935d3
      Alvaro Herrera authored
      This refines the previous weight range and allows a script to be "turned
      off" by passing a zero weight, which is useful when scripting multiple
      pgbench runs.
      
      I did not apply the suggested warning when a script uses zero weight; we
      use the principle elsewhere that if there's nothing to be done, do
      nothing quietly.
      
      Adjust docs accordingly.
      
      Author: Jeff Janes, Fabien Coelho
      a1c935d3
    • Robert Haas's avatar
      pgbench: Remove \setrandom. · ad956647
      Robert Haas authored
      You can now do the same thing via \set using the appropriate function,
      either random(), random_gaussian(), or random_exponential(), depending
      on the desired distribution.  This is not backward-compatible, but per
      discussion, it's worth it to avoid having the old syntax hang around
      forever.
      
      Fabien Coelho, reviewed by Michael Paquier, and adjusted by me.
      ad956647
    • Tom Lane's avatar
      Avoid possibly-unsafe use of Windows' FormatMessage() function. · 7abc1571
      Tom Lane authored
      Whenever this function is used with the FORMAT_MESSAGE_FROM_SYSTEM flag,
      it's good practice to include FORMAT_MESSAGE_IGNORE_INSERTS as well.
      Otherwise, if the message contains any %n insertion markers, the function
      will try to fetch argument strings to substitute --- which we are not
      passing, possibly leading to a crash.  This is exactly analogous to the
      rule about not giving printf() a format string you're not in control of.
      
      Noted and patched by Christian Ullrich.
      Back-patch to all supported branches.
      7abc1571
    • Teodor Sigaev's avatar
      Fix support of digits in email/hostnames. · 61d66c44
      Teodor Sigaev authored
      When tsearch was implemented I did several mistakes in hostname/email
      definition rules:
      1) allow underscore in hostname what prohibited by RFC
      2) forget to allow leading digits separated by hyphen (like 123-x.com)
         in hostname
      3) do no allow underscore/hyphen after leading digits in localpart of email
      
      Artur's patch resolves two last issues, but by the way allows hosts name like
      123_x.com together with 123-x.com. RFC forbids underscore usage in hostname
      but pg allows that since initial tsearch version in core, although only
      for non-digits. Patch syncs support digits and nondigits in both hostname and
      email.
      
      Forbidding underscore in hostname may break existsing usage of tsearch and,
      anyhow, it should be done by separate patch.
      
      Author: Artur Zakirov
      BUG: #13964
      61d66c44
    • Robert Haas's avatar
      Rework custom scans to work more like the new extensible node stuff. · f9143d10
      Robert Haas authored
      Per discussion, the new extensible node framework is thought to be
      better designed than the custom path/scan/scanstate stuff we added
      in PostgreSQL 9.5.  Rework the latter to be more like the former.
      
      This is not backward-compatible, but we generally don't promise that
      for C APIs, and there probably aren't many people using this yet
      anyway.
      
      KaiGai Kohei, reviewed by Petr Jelinek and me.  Some further
      cosmetic changes by me.
      f9143d10
    • Tom Lane's avatar
      Protect zic's symlink() call with #ifdef HAVE_SYMLINK. · 534da379
      Tom Lane authored
      The IANA crew seem to think that symlink() exists everywhere nowadays,
      and they may well be right.  But we use #ifdef HAVE_SYMLINK elsewhere
      so for consistency we should do it here too.  Noted by Michael Paquier.
      534da379
    • Tom Lane's avatar
      Fix zic for Windows. · 6d257e73
      Tom Lane authored
      The new coding of dolink() is dependent on link() returning an on-point
      errno when it fails; but the quick-hack implementation of link() that
      we'd put in for Windows didn't bother with setting errno.  Fix that.
      
      Analysis and patch by Christian Ullrich.
      6d257e73
    • Tom Lane's avatar
      Fix portability issues in 86c43f4e. · 656ee848
      Tom Lane authored
      INT64_MIN/MAX should be spelled PG_INT64_MIN/MAX, per well established
      convention in our sources.  Less obviously, a symbol named DOUBLE causes
      problems on Windows builds, so rename that to DOUBLE_CONST; and rename
      INTEGER to INTEGER_CONST for consistency.
      
      Also, get rid of incorrect/obsolete hand-munging of yycolumn, and fix
      the grammar for float constants to handle expected cases such as ".1".
      
      First two items by Michael Paquier, second two by me.
      656ee848
    • Robert Haas's avatar
      Don't require a user mapping for FDWs to work. · 5d4171d1
      Robert Haas authored
      Commit fbe5a3fb accidentally changed
      this behavior; put things back the way they were, and add some
      regression tests.
      
      Report by Andres Freund; patch by Ashutosh Bapat, with a bit of
      kibitzing by me.
      5d4171d1
    • Robert Haas's avatar
      On all Windows platforms, not just Cygwin, use _timezone and _tzname. · 868628e4
      Robert Haas authored
      Up until now, we've been using timezone and tzname, but Visual Studio
      2015 (for which we wish to add support) no longer declares those
      symbols.  All versions since Visual Studio 2003 apparently support the
      underscore-equipped names, and we don't support anything older than
      Visual Studio 2005, so this should work OK everywhere.  But let's see
      what the buildfarm thinks.
      
      Michael Paquier, reviewed by Petr Jelinek
      868628e4
    • Robert Haas's avatar
      Fix typo in comment. · bd0f206f
      Robert Haas authored
      Thomas Munro
      bd0f206f
    • Robert Haas's avatar
      pgbench: Support double constants and functions. · 86c43f4e
      Robert Haas authored
      The new functions are pi(), random(), random_exponential(),
      random_gaussian(), and sqrt().  I was worried that this would be
      slower than before, but, if anything, it actually turns out to be
      slightly faster, because we now express the built-in pgbench scripts
      using fewer lines; each \setrandom can be merged into a subsequent
      \set.
      
      Fabien Coelho
      86c43f4e
  4. 28 Mar, 2016 8 commits
    • Alvaro Herrera's avatar
      PostgresNode: initialize $timed_out if passed · 9bd61311
      Alvaro Herrera authored
      Corrects an oversight in 2c83f435 where the $timed_out reference var
      isn't initialized; using it would require the caller to initialize it
      beforehand, which is cumbersome.
      
      Author: Craig Ringer
      9bd61311
    • Alvaro Herrera's avatar
      Mention BRIN as able to do multi-column indexes · 80b986cf
      Alvaro Herrera authored
      Documentation mentioned B-tree, GiST and GIN as able to do multicolumn
      indexes; I failed to add BRIN to the list.
      
      Author: Petr Jediný
      Reviewed-By: Fujii Masao, Emre Hasegeli
      80b986cf
    • Tom Lane's avatar
      Sync tzload() and tzparse() APIs with IANA release tzcode2016c. · 1f4e9da6
      Tom Lane authored
      This brings us a bit closer to matching upstream, but since it affects
      files outside src/timezone/, we might choose not to back-patch it.
      Hence keep it separate from the main update patch.
      1f4e9da6
    • Tom Lane's avatar
      Fix MSVC build for changes in zic. · f5f15ea6
      Tom Lane authored
      zic now only needs zic.c, but I didn't realize knowledge about it was
      hardwired into Mkvcbuild.pm.  Per buildfarm.
      f5f15ea6
    • Tom Lane's avatar
      Sync our copy of the timezone library with IANA release tzcode2016c. · 1c1a7cbd
      Tom Lane authored
      We hadn't done this in about six years, which proves to have been a mistake
      because there's been a lot of code churn upstream, making the merge rather
      painful.  But putting it off any further isn't going to lessen the pain,
      and there are at least two incompatible changes that we need to absorb
      before someone starts complaining that --with-system-tzdata doesn't work
      at all on their platform, or we get blindsided by a tzdata release that
      our out-of-date zic can't compile.  Last week's "time zone abbreviation
      differs from POSIX standard" mess was a wake-up call in that regard.
      
      This is a sufficiently large patch that I'm afraid to back-patch it
      immediately, though the foregoing considerations imply that we probably
      should do so eventually.  For the moment, just put it in HEAD so that
      it can get some testing.  Maybe we can wait till the end of the 9.6
      beta cycle before deeming it okay.
      1c1a7cbd
    • Tom Lane's avatar
      Document errhidecontext() where it ought to be documented. · e5a4dea8
      Tom Lane authored
      Seems to have been missed when this function was added.  Noted while
      looking at David Steele's proposal to add another similar function.
      e5a4dea8
    • Alvaro Herrera's avatar
      Update expected file from quoting change · 4b746f0d
      Alvaro Herrera authored
      I neglected to update this in 59a2111b.
      
      Per buildfarm
      4b746f0d
    • Alvaro Herrera's avatar
      pg_rewind: Improve internationalization · cad3edef
      Alvaro Herrera authored
      This is mostly cosmetic since two of the three changes are debug
      messages, and the third one is just a progress indicator.
      
      Author: Michaël Paquier
      cad3edef