1. 02 3月, 2016 1 次提交
  2. 01 3月, 2016 9 次提交
    • P
      Add Unicode map generation scripts as rule prerequisites · bd6cf3f2
      Peter Eisentraut 提交于
      That way, the rules will trigger when the scripts change.
      bd6cf3f2
    • P
      Fix comments · cc074bf6
      Peter Eisentraut 提交于
      Some of these comments were copied and pasted without updating them,
      some of them were duplicates.
      cc074bf6
    • P
    • T
      Suppress scary-looking log messages from async-notify isolation test. · 3d523564
      Tom Lane 提交于
      I noticed that the async-notify test results in log messages like these:
      
      LOG:  could not send data to client: Broken pipe
      FATAL:  connection to client lost
      
      This is because it unceremoniously disconnects a client session that is
      about to have some NOTIFY messages delivered to it.  Such log messages
      during a regression test might well cause people to go looking for a
      problem that doesn't really exist (it did cause me to waste some time that
      way).  We can shut it up by adding an UNLISTEN command to session teardown.
      
      Patch HEAD only; this doesn't seem significant enough to back-patch.
      3d523564
    • T
      Improve error message for rejecting RETURNING clauses with dropped columns. · 8d8ff5f7
      Tom Lane 提交于
      This error message was written with only ON SELECT rules in mind, but since
      then we also made RETURNING-clause targetlists go through the same logic.
      This means that you got a rather off-topic error message if you tried to
      add a rule with RETURNING to a table having dropped columns.  Ideally we'd
      just support that, but some preliminary investigation says that it might be
      a significant amount of work.  Seeing that Nicklas Avén's complaint is the
      first one we've gotten about this in the ten years or so that the code's
      been like that, I'm unwilling to put much time into it.  Instead, improve
      the error report by issuing a different message for RETURNING cases, and
      revise the associated comment based on this investigation.
      
      Discussion: 1456176604.17219.9.camel@jordogskog.no
      8d8ff5f7
    • A
      Minor tweaks for new src/test/recovery · 5847397d
      Alvaro Herrera 提交于
      Author: Michael Paquier
      5847397d
    • A
      Fix typos · 10b48522
      Alvaro Herrera 提交于
      Author: Amit Langote
      10b48522
    • A
      doc: document MANPATH as /usr/local/pgsql/share/man · 1c7c189f
      Alvaro Herrera 提交于
      The docs were advising to use /usr/local/pgsql/man instead, but that's
      wrong.
      
      Reported-By: Slawomir Sudnik
      Backpatch-To: 9.1
      Bug: #13894
      1c7c189f
    • A
      Make new isolationtester test more stable · 54638f57
      Alvaro Herrera 提交于
      The original coding of the test was relying too much on the ordering in
      which backends are awakened once an advisory lock which they wait for is
      released.  Change the code so that each backend uses its own advisory
      lock instead, so that the output becomes stable.  Also add a few seconds
      of sleep between lock releases, so that the test isn't broken in
      overloaded buildfarm animals, as suggested by Tom Lane.
      
      Per buildfarm members spoonbill and guaibasaurus.
      
      Discussion: https://www.postgresql.org/message-id/19294.1456551587%40sss.pgh.pa.us
      54638f57
  3. 29 2月, 2016 4 次提交
    • T
      Remove useless unary plus. · c110678a
      Tom Lane 提交于
      It's harmless, but might confuse readers.  Seems to have been introduced
      in 6bc8ef0b.  Back-patch, just to avoid cosmetic cross-branch
      differences.
      
      Amit Langote
      c110678a
    • T
      Fix build under OPTIMIZER_DEBUG. · 05893712
      Tom Lane 提交于
      In commit 19a54114 I replaced RelOptInfo.width with
      RelOptInfo.reltarget.width, but I missed updating debug_print_rel()
      for that because it's not compiled by default.
      Reported by Salvador Fandino, patch by Michael Paquier.
      05893712
    • D
      Fix incorrect varlevelsup in security_barrier_replace_vars(). · 41fedc24
      Dean Rasheed 提交于
      When converting an RTE with securityQuals into a security barrier
      subquery RTE, ensure that the Vars in the new subquery's targetlist
      all have varlevelsup = 0 so that they correctly refer to the
      underlying base relation being wrapped.
      
      The original code was creating new Vars by copying them from existing
      Vars referencing the base relation found elsewhere in the query, but
      failed to account for the fact that such Vars could come from sublink
      subqueries, and hence have varlevelsup > 0. In practice it looks like
      this could only happen with nested security barrier views, where the
      outer view has a WHERE clause containing a correlated subquery, due to
      the order in which the Vars are processed.
      
      Bug: #13988
      Reported-by: Adam Guthrie
      Backpatch-to: 9.4, where updatable SB views were introduced
      41fedc24
    • T
      Avoid multiple free_struct_lconv() calls on same data. · 907e4dd2
      Tom Lane 提交于
      A failure partway through PGLC_localeconv() led to a situation where
      the next call would call free_struct_lconv() a second time, leading
      to free() on already-freed strings, typically leading to a core dump.
      Add a flag to remember whether we need to do that.
      
      Per report from Thom Brown.  His example case only provokes the failure
      as far back as 9.4, but nonetheless this code is obviously broken, so
      back-patch to all supported branches.
      907e4dd2
  4. 28 2月, 2016 2 次提交
  5. 27 2月, 2016 4 次提交
  6. 26 2月, 2016 6 次提交
  7. 25 2月, 2016 3 次提交
    • R
      Enable parallelism for prepared statements and extended query protocol. · 57a6a72b
      Robert Haas 提交于
      Parallel query can't handle running a query only partially rather than
      to completion.  However, there seems to be no way to run a statement
      prepared via SQL PREPARE other than to completion, so we can enable it
      there without a problem.
      
      The situation is more complicated for the extend query protocol.
      libpq seems to provide no way to send an Execute message with a
      non-zero rowcount, but some other client might.  If that happens, and
      a parallel plan was chosen, we'll execute the parallel plan without
      using any workers, which may be somewhat inefficient but should still
      work.  Hopefully this won't be a problem; users can always set
      max_parallel_degree=0 to avoid choosing parallel plans in the first
      place.
      
      Amit Kapila, reviewed by me.
      57a6a72b
    • N
      Clean the last few TAP suite tmp_check directories. · 25924ac4
      Noah Misch 提交于
      Back-patch to 9.5, where the suites were introduced.
      25924ac4
    • N
      MSVC: Clean tmp_check directory of pg_controldata test suite. · 41635887
      Noah Misch 提交于
      Back-patch to 9.4, where the suite was introduced.
      41635887
  8. 23 2月, 2016 2 次提交
    • T
      Create a function to reliably identify which sessions block which others. · 52f5d578
      Tom Lane 提交于
      This patch introduces "pg_blocking_pids(int) returns int[]", which returns
      the PIDs of any sessions that are blocking the session with the given PID.
      Historically people have obtained such information using a self-join on
      the pg_locks view, but it's unreasonably tedious to do it that way with any
      modicum of correctness, and the addition of parallel queries has pretty
      much broken that approach altogether.  (Given some more columns in the view
      than there are today, you could imagine handling parallel-query cases with
      a 4-way join; but ugh.)
      
      The new function has the following behaviors that are painful or impossible
      to get right via pg_locks:
      
      1. Correctly understands which lock modes block which other ones.
      
      2. In soft-block situations (two processes both waiting for conflicting lock
      modes), only the one that's in front in the wait queue is reported to
      block the other.
      
      3. In parallel-query cases, reports all sessions blocking any member of
      the given PID's lock group, and reports a session by naming its leader
      process's PID, which will be the pg_backend_pid() value visible to
      clients.
      
      The motivation for doing this right now is mostly to fix the isolation
      tests.  Commit 38f8bdca lobotomized
      isolationtester's is-it-waiting query by removing its ability to recognize
      nonconflicting lock modes, as a crude workaround for the inability to
      handle soft-block situations properly.  But even without the lock mode
      tests, the old query was excessively slow, particularly in
      CLOBBER_CACHE_ALWAYS builds; some of our buildfarm animals fail the new
      deadlock-hard test because the deadlock timeout elapses before they can
      probe the waiting status of all eight sessions.  Replacing the pg_locks
      self-join with use of pg_blocking_pids() is not only much more correct, but
      a lot faster: I measure it at about 9X faster in a typical dev build with
      Asserts, and 3X faster in CLOBBER_CACHE_ALWAYS builds.  That should provide
      enough headroom for the slower CLOBBER_CACHE_ALWAYS animals to pass the
      test, without having to lengthen deadlock_timeout yet more and thus slow
      down the test for everyone else.
      52f5d578
    • T
      Remove redundant PGPROC.lockGroupLeaderIdentifier field. · 73bf8715
      Tom Lane 提交于
      We don't really need this field, because it's either zero or redundant with
      PGPROC.pid.  The use of zero to mark "not a group leader" is not necessary
      since we can just as well test whether lockGroupLeader is NULL.  This does
      not save very much, either as to code or data, but the simplification seems
      worthwhile anyway.
      73bf8715
  9. 22 2月, 2016 3 次提交
    • A
      Fix wrong keysize in PrivateRefCountHash creation. · ea56b06c
      Andres Freund 提交于
      In 4b4b680c I accidentally used sizeof(PrivateRefCountArray) instead of
      sizeof(PrivateRefCountEntry) when creating the refcount overflow
      hashtable. As the former is bigger than the latter, this luckily only
      resulted in a slightly increased memory usage when many buffers are
      pinned in a backend.
      
      Reported-By: Takashi Horikawa
      Discussion: 73FA3881462C614096F815F75628AFCD035A48C3@BPXM01GP.gisp.nec.co.jp
      Backpatch: 9.5, where thew new ref count infrastructure was introduced
      ea56b06c
    • T
      Docs: make prose discussion match the ordering of Table 9-58. · 64a169d1
      Tom Lane 提交于
      The "Session Information Functions" table seems to be sorted mostly
      alphabetically (although it's not perfect), which would be all right
      if it didn't lead to some related functions being described in a
      pretty nonintuitive order.  Also, the prose discussions after the table
      were in an order that hardly matched the table at all.  Rearrange to
      make things a bit easier to follow.
      64a169d1
    • T
      Cosmetic improvements in new config_info code. · c7a1c5a6
      Tom Lane 提交于
      Coverity griped about use of unchecked strcpy() into a local variable.
      There's unlikely to be any actual bug there, since no caller would be
      passing a path longer than MAXPGPATH, but nonetheless use of strlcpy()
      seems preferable.
      
      While at it, get rid of unmaintainable separation between list of
      field names and list of field values in favor of initializing them
      in parallel.  And we might as well declare get_configdata()'s path
      argument as const char *, even though no current caller needs that.
      c7a1c5a6
  10. 21 2月, 2016 5 次提交
    • A
      Fix two-argument jsonb_object when called with empty arrays · 94c745eb
      Andrew Dunstan 提交于
      Some over-eager copy-and-pasting on my part resulted in a nonsense
      result being returned in this case. I have adopted the same pattern for
      handling this case as is used in the one argument form of the function,
      i.e. we just skip over the code that adds values to the object.
      
      Diagnosis and patch from Michael Paquier, although not quite his
      solution.
      
      Fixes bug #13936.
      
      Backpatch to 9.5 where jsonb_object was introduced.
      94c745eb
    • R
      Fix incorrect decision about which lock to take. · 88aca566
      Robert Haas 提交于
      Spotted by Tom Lane.
      88aca566
    • R
      Cosmetic improvements to group locking. · d91a4a6c
      Robert Haas 提交于
      Reflow text in lock manager README so that it fits within 80 columns.
      Correct some mistakes.  Expand the README to explain not only why group
      locking exists but also the data structures that support it.  Improve
      comments related to group locking several files.  Change the name of a
      macro argument for improved clarity.
      
      Most of these problems were reported by Tom Lane, but I found a few
      of them myself.
      
      Robert Haas and Tom Lane
      d91a4a6c
    • R
      postgres_fdw: Avoid sharing list substructure. · dd077ef8
      Robert Haas 提交于
      list_concat(list_concat(a, b), c) destructively changes both a and b;
      to avoid such perils, copy lists of remote_conds before incorporating
      them into larger lists via list_concat().
      
      Ashutosh Bapat, per a report from Etsuro Fujita
      dd077ef8
    • T
      Fix wording in the Tutorial document. · 902fd1f4
      Tatsuo Ishii 提交于
      With suggentions from Tom Lane.
      902fd1f4
  11. 20 2月, 2016 1 次提交