1. 05 Feb, 2014 2 commits
  2. 04 Feb, 2014 4 commits
    • Tom Lane's avatar
      Improve connection-failure error handling in contrib/postgres_fdw. · 00d4f2af
      Tom Lane authored
      postgres_fdw tended to say "unknown error" if it tried to execute a command
      on an already-dead connection, because some paths in libpq just return a
      null PGresult for such cases.  Out-of-memory might result in that, too.
      To fix, pass the PGconn to pgfdw_report_error, and look at its
      PQerrorMessage() string if we can't get anything out of the PGresult.
      
      Also, fix the transaction-exit logic to reliably drop a dead connection.
      It was attempting to do that already, but it assumed that only connection
      cache entries with xact_depth > 0 needed to be examined.  The folly in that
      is that if we fail while issuing START TRANSACTION, we'll not have bumped
      xact_depth.  (At least for the case I was testing, this fix masks the
      other problem; but it still seems like a good idea to have the PGconn
      fallback logic.)
      
      Per investigation of bug #9087 from Craig Lucas.  Backpatch to 9.3 where
      this code was introduced.
      00d4f2af
    • Fujii Masao's avatar
      Fix comparison of an array of characters with zero to compare with '\0' instead. · 489e6ac5
      Fujii Masao authored
      Report from Andres Freund.
      489e6ac5
    • Robert Haas's avatar
      Rephrase text to avoid links in regress.sgml · c1fe08eb
      Robert Haas authored
      Otherwise, the standalone regress_README build gets unhappy.
      c1fe08eb
    • Tom Lane's avatar
      Fix lexing of U& sequences just before EOF. · 0c2338ab
      Tom Lane authored
      Commit a5ff502f was a brick shy of a load
      in the backend lexer too, not just psql.  Per further testing of bug #9068.
      
      In passing, improve related comments.
      0c2338ab
  3. 03 Feb, 2014 5 commits
  4. 02 Feb, 2014 6 commits
  5. 01 Feb, 2014 13 commits
    • Tom Lane's avatar
      Fix some wide-character bugs in the text-search parser. · 082c0dfa
      Tom Lane authored
      In p_isdigit and other character class test functions generated by the
      p_iswhat macro, the code path for non-C locales with multibyte encodings
      contained a bogus pointer cast that would accidentally fail to malfunction
      if types wchar_t and wint_t have the same width.  Apparently that is true
      on most platforms, but not on recent Cygwin releases.  Remove the cast,
      as it seems completely unnecessary (I think it arose from a false analogy
      to the need to cast to unsigned char when dealing with the <ctype.h>
      functions).  Per bug #8970 from Marco Atzeri.
      
      In the same functions, the code path for C locale with a multibyte encoding
      simply ANDed each wide character with 0xFF before passing it to the
      corresponding <ctype.h> function.  This could result in false positive
      answers for some non-ASCII characters, so use a range test instead.
      Noted by me while investigating Marco's complaint.
      
      Also, remove some useless though not actually buggy maskings and casts
      in the hand-coded p_isalnum and p_isalpha functions, which evidently
      got tested a bit more carefully than the macro-generated functions.
      082c0dfa
    • Andrew Dunstan's avatar
      fix whitespace · c8158a2e
      Andrew Dunstan authored
      c8158a2e
    • Tom Lane's avatar
      Fix some more bugs in signal handlers and process shutdown logic. · 214c7a4f
      Tom Lane authored
      WalSndKill was doing things exactly backwards: it should first clear
      MyWalSnd (to stop signal handlers from touching MyWalSnd->latch),
      then disown the latch, and only then mark the WalSnd struct unused by
      clearing its pid field.
      
      Also, WalRcvSigUsr1Handler and worker_spi_sighup failed to preserve
      errno, which is surely a requirement for any signal handler.
      
      Per discussion of recent buildfarm failures.  Back-patch as far
      as the relevant code exists.
      214c7a4f
    • Andrew Dunstan's avatar
      Don't use deprecated dllwrap on Cygwin. · 7e1531a4
      Andrew Dunstan authored
      The preferred method is to use "cc -shared", and this allows binaries
      to be rebased if required, unlike dllwrap.
      
      Backpatch to 9.0 where we have buildfarm coverage.
      
      There are still some issues with Cygwin, especially modern Cygwin, but
      this helps us get closer to good support.
      
      Marco Atzeri.
      7e1531a4
    • Andrew Dunstan's avatar
      Copy the libpq DLL to the bin directory on Mingw and Cygwin. · d587298b
      Andrew Dunstan authored
      This has long been done by the MSVC build system, and has caused
      confusion in the past when programs like psql have failed to start
      because they can't find the DLL. If it's in the same directory as it now
      will be they will find it.
      
      Backpatch to all live branches.
      d587298b
    • Bruce Momjian's avatar
      arrays: tighten checks for multi-dimensional input · d0ee9379
      Bruce Momjian authored
      Previously an input array string that started with a single-element
      array dimension would then later accept a multi-dimensional segment.
      
      BACKWARD INCOMPATIBILITY
      d0ee9379
    • Robert Haas's avatar
      Introduce replication slots. · 858ec118
      Robert Haas authored
      Replication slots are a crash-safe data structure which can be created
      on either a master or a standby to prevent premature removal of
      write-ahead log segments needed by a standby, as well as (with
      hot_standby_feedback=on) pruning of tuples whose removal would cause
      replication conflicts.  Slots have some advantages over existing
      techniques, as explained in the documentation.
      
      In a few places, we refer to the type of replication slots introduced
      by this patch as "physical" slots, because forthcoming patches for
      logical decoding will also have slots, but with somewhat different
      properties.
      
      Andres Freund and Robert Haas
      858ec118
    • Bruce Momjian's avatar
      docs: mention 'g' is not in the regex embedded options table · 5bdef38b
      Bruce Momjian authored
      Mentioned in substring() and regexp_replace() sections.
      5bdef38b
    • Bruce Momjian's avatar
      pg_restore: make help output plural for multi-enabled options · 5168c769
      Bruce Momjian authored
      per report from Josh Kupershmidt
      5168c769
    • Robert Haas's avatar
      Clear MyProc and MyProcSignalState before they become invalid. · d1981719
      Robert Haas authored
      Evidence from buildfarm member crake suggests that the new test_shm_mq
      module is routinely crashing the server due to the arrival of a SIGUSR1
      after the shared memory segment has been unmapped.  Although processes
      using the new dynamic background worker facilities are more likely to
      receive a SIGUSR1 around this time, the problem is also possible on older
      branches, so I'm back-patching the parts of this change that apply to
      older branches as far as they apply.
      
      It's already generally the case that code checks whether these pointers
      are NULL before deferencing them, so the important thing is mostly to
      make sure that they do get set to NULL before they become invalid.  But
      in master, there's one case in procsignal_sigusr1_handler that lacks a
      NULL guard, so add that.
      
      Patch by me; review by Tom Lane.
      d1981719
    • Bruce Momjian's avatar
      doc: mention statistics reset during crash recovery · 637fab6e
      Bruce Momjian authored
      Takayuki Tsunakawa
      637fab6e
    • Bruce Momjian's avatar
      chkpass: check for NULL return value from crypt() · 6afe200c
      Bruce Momjian authored
      Report from Jozef Mlich using Coverity
      6afe200c
    • Bruce Momjian's avatar
      doc: mention data page checksums in WAL section · 85317e88
      Bruce Momjian authored
      Backpatch to 9.3
      
      Adjusted patch from Ian Lawrence Barwick
      85317e88
  6. 31 Jan, 2014 10 commits