1. 08 Jul, 2015 1 commit
    • Heikki Linnakangas's avatar
      Replace our hacked version of ax_pthread.m4 with latest upstream version. · e97af6c8
      Heikki Linnakangas authored
      Our version was different from the upstream version in that we tried to use
      all possible pthread-related flags that the compiler accepts, rather than
      just the first one that works. That change was made in commit
      e48322a6, to work-around a bug affecting GCC
      versions 3.2 and below (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=8888),
      although we didn't realize that it was a GCC bug at the time. We hardly care
      about that old GCC versions anymore, so we no longer need that workaround.
      
      This fixes the macro for compilers that print warnings with the chosen
      flags. That's pretty annoying on its own right, but it also inconspicuously
      disabled thread-safety, because we refused to use any pthread-related flags
      if the compiler produced warnings. Max Filippov reported that problem when
      linking with uClibc and OpenSSL. The warnings-check was added because the
      workaround for the GCC bug caused warnings otherwise, so it's no longer
      needed either. We can just use the upstream version as is.
      
      If you really want to compile with GCC version 3.2 or older, you can still
      work-around it manually by setting PTHREAD_CFLAGS="-pthread -lpthread"
      manually on the configure command line.
      
      Backpatch to 9.5. I don't want to unnecessarily rock the boat on stable
      branches, but 9.5 seems like fair game.
      e97af6c8
  2. 07 Jul, 2015 10 commits
    • Joe Conway's avatar
      Improve regression test coverage of table lock modes vs permissions. · e66a4534
      Joe Conway authored
      Test the interactions with permissions and LOCK TABLE. Specifically
      ROW EXCLUSIVE, ACCESS SHARE, and ACCESS EXCLUSIVE modes against
      SELECT, INSERT, UPDATE, DELETE, and TRUNCATE permissions. Discussed
      by Stephen Frost and Michael Paquier, patch by the latter. Backpatch
      to 9.5 where matching behavior was first committed.
      e66a4534
    • Fujii Masao's avatar
      Fix incorrect path in pg_regress log messages. · 61fc420b
      Fujii Masao authored
      Back-patch to 9.5 where the bug was introduced.
      
      David Christensen
      61fc420b
    • Tom Lane's avatar
      Fix portability issue in pg_upgrade test script: avoid $PWD. · 9a8f5833
      Tom Lane authored
      SUSv2-era shells don't set the PWD variable, though anything more modern
      does.  In the buildfarm environment this could lead to test.sh executing
      with PWD pointing to $HOME or another high-level directory, so that there
      were conflicts between concurrent executions of the test in different
      branch subdirectories.  This appears to be the explanation for recent
      intermittent failures on buildfarm members binturong and dingo (and might
      well have something to do with the buildfarm script's failure to capture
      log files from pg_upgrade tests, too).
      
      To fix, just use `pwd` in place of $PWD.  AFAICS test.sh is the only place
      in our source tree that depended on $PWD.  Back-patch to all versions
      containing this script.
      
      Per buildfarm.  Thanks to Oskari Saarenmaa for diagnosing the problem.
      9a8f5833
    • Heikki Linnakangas's avatar
      Improve handling of out-of-memory in libpq. · 414bef30
      Heikki Linnakangas authored
      If an allocation fails in the main message handling loop, pqParseInput3
      or pqParseInput2, it should not be treated as "not enough data available
      yet". Otherwise libpq will wait indefinitely for more data to arrive from
      the server, and gets stuck forever.
      
      This isn't a complete fix - getParamDescriptions and getCopyStart still
      have the same issue, but it's a step in the right direction.
      
      Michael Paquier and me. Backpatch to all supported versions.
      414bef30
    • Fujii Masao's avatar
      Add tab-completion for psql meta-commands. · c81c9564
      Fujii Masao authored
      Based on the original code from David Christensen, modified by me.
      c81c9564
    • Andres Freund's avatar
      Refer to %p in the psql docs as 'process ID' not 'pid'. · 4af04f96
      Andres Freund authored
      Per Tom.
      4af04f96
    • Andres Freund's avatar
      Add psql PROMPT variable showing the pid of the connected to backend. · 275f05c9
      Andres Freund authored
      The substitution for the pid is %p.
      
      Author: Julien Rouhaud
      Discussion: 116262CF971C844FB6E793F8809B51C6E99D48@BPXM02GP.gisp.nec.co.jp
      275f05c9
    • Andres Freund's avatar
      Fix logical decoding bug leading to inefficient reopening of files. · b2f6f749
      Andres Freund authored
      When spilling transaction data to disk a simple typo caused the output
      file to be closed and reopened for every serialized change. That happens
      to not have a huge impact on linux, which is why it probably wasn't
      noticed so far, but on windows that appears to trigger actual disk
      writes after every change. Not fun.
      
      The bug fortunately does not have any impact besides speed. A change
      could end up being in the wrong segment (last instead of next), but
      since we read all files to the end, that's just ugly, not really
      problematic. It's not a problem to upgrade, since transaction spill
      files do not persist across restarts.
      
      Bug: #13484
      Reported-By: Olivier Gosseaume
      Discussion: 20150703090217.1190.63940@wrigleys.postgresql.org
      
      Backpatch to 9.4, where logical decoding was added.
      b2f6f749
    • Andres Freund's avatar
      Fix pg_recvlogical not to fsync output when it's a tty or pipe. · 5c0de384
      Andres Freund authored
      The previous coding tried to handle possible failures when fsyncing a
      tty or pipe fd by accepting EINVAL - but apparently some
      platforms (windows, OSX) don't reliably return that. So instead check
      whether the output fd refers to a pipe or a tty when opening it.
      
      Reported-By: Olivier Gosseaume, Marko Tiikkaja
      Discussion: 559AF98B.3050901@joh.to
      
      Backpatch to 9.4, where pg_recvlogical was added.
      5c0de384
    • Joe Conway's avatar
      Make RLS related error messages more consistent and compliant. · 02eac01f
      Joe Conway authored
      Also updated regression expected output to match. Noted and patch by Daniele Varrazzo.
      02eac01f
  3. 06 Jul, 2015 4 commits
    • Heikki Linnakangas's avatar
      Turn install.bat into a pure one line wrapper fort he perl script. · 6c534fd6
      Heikki Linnakangas authored
      Build.bat and vcregress.bat got similar treatment years ago. I'm not sure
      why install.bat wasn't treated at the same time, but it seems like a good
      idea anyway.
      
      The immediate problem with the old install.bat was that it had quoting
      issues, and wouldn't work if the target directory's name contained spaces.
      This fixes that problem.
      6c534fd6
    • Heikki Linnakangas's avatar
      Call getsockopt() on the correct socket. · 8e33fc17
      Heikki Linnakangas authored
      We're interested in the buffer size of the socket that's connected to the
      client, not the one that's listening for new connections. It happened to
      work, as default buffer size is the same on both, but it was clearly not
      wrong.
      
      Spotted by Tom Lane
      8e33fc17
    • Heikki Linnakangas's avatar
      Don't set SO_SNDBUF on recent Windows versions that have a bigger default. · 4f33621f
      Heikki Linnakangas authored
      It's unnecessary to set it if the default is higher in the first place.
      Furthermore, setting SO_SNDBUF disables the so-called "dynamic send
      buffering" feature, which hurts performance further. This can be seen
      especially when the network between the client and the server has high
      latency.
      
      Chen Huajun
      4f33621f
    • Fujii Masao's avatar
      Remove incorrect warning from pg_archivecleanup document. · 906e9249
      Fujii Masao authored
      The .backup file name can be passed to pg_archivecleanup even if
      it includes the extension which is specified in -x option.
      However, previously the document incorrectly warned a user
      not to do that.
      
      Back-patch to 9.2 where pg_archivecleanup's -x option and
      the warning were added.
      906e9249
  4. 05 Jul, 2015 4 commits
    • Tom Lane's avatar
      Make a editorial pass over pgbench's error messages. · 22ba5563
      Tom Lane authored
      The lack of consistency, and lack of attention to our message style
      guidelines, was a bit striking.  Try to make 'em better.
      22ba5563
    • Tom Lane's avatar
      Fix some typos in regression test comments. · 55165497
      Tom Lane authored
      Back-patch to avoid unnecessary cross-branch differences.
      
      CharSyam
      55165497
    • Tom Lane's avatar
      Further reduce overhead for passing plpgsql variables to the executor. · 6c82d8d1
      Tom Lane authored
      This builds on commit 21dcda27 by keeping
      a plpgsql function's shared ParamListInfo's entries for simple variables
      (PLPGSQL_DTYPE_VARs) valid at all times.  That adds a few cycles to each
      assignment to such variables, but saves significantly more cycles each time
      they are used; so except in the pathological case of many dead stores, this
      should always be a win.  Initial testing says it's good for about a 10%
      speedup of simple calculations; more in large functions with many datums.
      
      We can't use this method for row/record references unfortunately, so what
      we do for those is reset those ParamListInfo slots after use; which we
      can skip doing unless some of them were actually evaluated during the
      previous evaluation call.  So this should frequently be a win as well,
      while worst case is that it's similar cost to the previous approach.
      
      Also, closer study suggests that the previous method of instantiating a
      new ParamListInfo array per evaluation is actually probably optimal for
      cursor-opening executor calls.  The reason is that whatever is visible in
      the array is going to get copied into the cursor portal via copyParamList.
      So if we used the function's main ParamListInfo for those calls, we'd end
      up with all of its DTYPE_VAR vars getting copied, which might well include
      large pass-by-reference values that the cursor actually has no need for.
      To avoid a possible net degradation in cursor cases, go back to creating
      and filling a private ParamListInfo in those cases (which therefore will be
      exactly the same speed as before 21dcda27).  We still get some benefit
      out of this though, because this approach means that we only have to defend
      against copyParamList's try-to-fetch-every-slot behavior in the case of an
      unshared ParamListInfo; so plpgsql_param_fetch() can skip testing
      expr->paramnos in the common case.
      
      To ensure that the main ParamListInfo's image of a DTYPE_VAR datum is
      always valid, all assignments to such variables are now funneled through
      assign_simple_var().  But this makes for cleaner and shorter code anyway.
      6c82d8d1
    • Tom Lane's avatar
      Fix bad grammar in brin.sgml. · 25240462
      Tom Lane authored
      Christoph Berg
      25240462
  5. 03 Jul, 2015 6 commits
  6. 02 Jul, 2015 15 commits