1. 08 Sep, 2015 7 commits
  2. 07 Sep, 2015 8 commits
    • Noah Misch's avatar
      In the pg_rewind test suite, receive WAL fully before promoting. · 582fbffb
      Noah Misch authored
      If a transaction never reaches the standby, later tests find unexpected
      cluster state.  A "tail-copy: query result matches" test failure has
      been the usual symptom.  Among the buildfarm members having run this
      test suite, most have exhibited that symptom at least once.  Back-patch
      to 9.5, where pg_rewind was introduced.
      
      Michael Paquier, reported by Christoph Berg.
      582fbffb
    • Jeff Davis's avatar
      Coordinate log_line_prefix options 'm' and 'n' to share a timeval. · b1e1862a
      Jeff Davis authored
      Commit f828654e introduced the 'n' option, but it invoked
      gettimeofday() independently of the 'm' option. If both options were
      in use (or multiple 'n' options), or if 'n' was in use along with
      csvlog, then the reported times could be different for the same log
      message.
      
      To fix, initialize a global variable with gettimeofday() once per log
      message, and use that for both formats.
      
      Don't bother coordinating the time for the 't' option, which has much
      lower resolution.
      
      Per complaint by Alvaro Herrera.
      b1e1862a
    • Alvaro Herrera's avatar
      Add more sanity checks in contrib/sslinfo · d94c36a4
      Alvaro Herrera authored
      We were missing a few return checks on OpenSSL calls.  Should be pretty
      harmless, since we haven't seen any user reports about problems, and
      this is not a high-traffic module anyway; still, a bug is a bug, so
      backpatch this all the way back to 9.0.
      
      Author: Michael Paquier, while reviewing another sslinfo patch
      d94c36a4
    • Jeff Davis's avatar
      Add log_line_prefix option 'n' for Unix epoch. · f828654e
      Jeff Davis authored
      Prints time as Unix epoch with milliseconds.
      
      Tomas Vondra, reviewed by Fabien Coelho.
      f828654e
    • Greg Stark's avatar
      Change type of DOW/DOY to UNITS · 37239ef8
      Greg Stark authored
      37239ef8
    • Teodor Sigaev's avatar
      Make GIN's cleanup pending list process interruptable · e2669224
      Teodor Sigaev authored
      Cleanup process could be called by ordinary insert/update and could take a lot
      of time. Add vacuum_delay_point() to make this process interruptable. Under
      vacuum this call will also throttle a vacuum process to decrease system load,
      called from insert/update it will not throttle, and that reduces a latency.
      
      Backpatch for all supported branches.
      
      Jeff Janes <jeff.janes@gmail.com>
      e2669224
    • Teodor Sigaev's avatar
      Add pages deleted from pending list to FSM · e9568083
      Teodor Sigaev authored
      Add pages deleted from GIN's pending list during cleanup to free space map
      immediately. Clean up process could be initiated by ordinary insert but adding
      page to FSM might occur only at vacuum. On some workload like never-vacuumed
      insert-only tables it could cause a huge bloat.
      
      Jeff Janes <jeff.janes@gmail.com>
      e9568083
    • Teodor Sigaev's avatar
      Update site address of Snowball project · a1c44e1a
      Teodor Sigaev authored
      a1c44e1a
  3. 06 Sep, 2015 4 commits
    • Joe Conway's avatar
      Adjust sepgsql regression output for recent error context change · 03543afe
      Joe Conway authored
      Recent commit 0426f349 changed handling of error context reports
      in such a way to have a minor effect on the sepgsql regression
      output. Adapt the expected output file to suit. Since that commit
      was HEAD only, so is this one.
      03543afe
    • Magnus Hagander's avatar
      Support RADIUS passwords up to 128 characters · 643beffe
      Magnus Hagander authored
      Previous limit was 16 characters, due to lack of support for multiple passes
      of encryption.
      
      Marko Tiikkaja
      643beffe
    • Andres Freund's avatar
      Add ability to reserve WAL upon slot creation via replication protocol. · c314ead5
      Andres Freund authored
      Since 6fcd8851 it is possible to immediately reserve WAL when creating a
      slot via pg_create_physical_replication_slot(). Extend the replication
      protocol to allow that as well.
      
      Although, in contrast to the SQL interface, it is possible to update the
      reserved location via the replication interface, it is still useful
      being able to reserve upon creation there. Otherwise the logic in
      ReplicationSlotReserveWal() has to be repeated in slot employing
      clients.
      
      Author: Michael Paquier
      Discussion: CAB7nPqT0Wc1W5mdYGeJ_wbutbwNN+3qgrFR64avXaQCiJMGaYA@mail.gmail.com
      c314ead5
    • Greg Stark's avatar
      Move DTK_ISODOW DTK_DOW and DTK_DOY to be type UNITS rather than · 258ee1b6
      Greg Stark authored
      RESERV. RESERV is meant for tokens like "now" and having them in that
      category throws errors like these when used as an input date:
      
      stark=# SELECT 'doy'::timestamptz;
      ERROR:  unexpected dtype 33 while parsing timestamptz "doy"
      LINE 1: SELECT 'doy'::timestamptz;
                     ^
      stark=# SELECT 'dow'::timestamptz;
      ERROR:  unexpected dtype 32 while parsing timestamptz "dow"
      LINE 1: SELECT 'dow'::timestamptz;
                     ^
      
      Found by LLVM's Libfuzzer
      258ee1b6
  4. 05 Sep, 2015 4 commits
    • Tom Lane's avatar
      Fix CreateTableSpace() so it will compile without HAVE_SYMLINK. · 9270d8db
      Tom Lane authored
      This has been broken since 9.3 (commit 82b1b213 to be exact),
      which suggests that nobody is any longer using a Windows build system that
      doesn't provide a symlink emulation.  Still, it's wrong on its own terms,
      so repair.
      
      YUriy Zhuravlev
      9270d8db
    • Tom Lane's avatar
      Rearrange the handling of error context reports. · 0426f349
      Tom Lane authored
      Remove the code in plpgsql that suppressed the innermost line of CONTEXT
      for messages emitted by RAISE commands.  That was never more than a quick
      backwards-compatibility hack, and it's pretty silly in cases where the
      RAISE is nested in several levels of function.  What's more, it violated
      our design theory that verbosity of error reports should be controlled
      on the client side not the server side.
      
      To alleviate the resulting noise increase, introduce a feature in libpq
      and psql whereby the CONTEXT field of messages can be suppressed, either
      always or only for non-error messages.  Printing CONTEXT for errors only
      is now their default behavior.
      
      The actual code changes here are pretty small, but the effects on the
      regression test outputs are widespread.  I had to edit some of the
      alternative expected outputs by hand; hopefully the buildfarm will soon
      find anything I fat-fingered.
      
      In passing, fix up (again) the output line counts in psql's various
      help displays.  Add some commentary about how to verify them.
      
      Pavel Stehule, reviewed by Petr Jelínek, Jeevan Chalke, and others
      0426f349
    • Heikki Linnakangas's avatar
      Fix misc typos. · c80b5f66
      Heikki Linnakangas authored
      Oskari Saarenmaa. Backpatch to stable branches where applicable.
      c80b5f66
    • Tatsuo Ishii's avatar
      Fix brin index summarizing while vacuuming. · c39f5674
      Tatsuo Ishii authored
      If the number of heap blocks is not multiples of pages per range, the
      summarizing produces wrong summary information for the last brin index
      tuple while vacuuming.
      
      Problem reported by Tatsuo Ishii and fixed by Amit Langote.
      
      Discussion at "[HACKERS] BRIN INDEX value (message id :20150903.174935.1946402199422994347.t-ishii@sraoss.co.jp)
      Backpatched to 9.5 in which brin index was added.
      c39f5674
  5. 04 Sep, 2015 2 commits
    • Tom Lane's avatar
      Fix subtransaction cleanup after an outer-subtransaction portal fails. · c5454f99
      Tom Lane authored
      Formerly, we treated only portals created in the current subtransaction as
      having failed during subtransaction abort.  However, if the error occurred
      while running a portal created in an outer subtransaction (ie, a cursor
      declared before the last savepoint), that has to be considered broken too.
      
      To allow reliable detection of which ones those are, add a bookkeeping
      field to struct Portal that tracks the innermost subtransaction in which
      each portal has actually been executed.  (Without this, we'd end up
      failing portals containing functions that had called the subtransaction,
      thereby breaking plpgsql exception blocks completely.)
      
      In addition, when we fail an outer-subtransaction Portal, transfer its
      resources into the subtransaction's resource owner, so that they're
      released early in cleanup of the subxact.  This fixes a problem reported by
      Jim Nasby in which a function executed in an outer-subtransaction cursor
      could cause an Assert failure or crash by referencing a relation created
      within the inner subtransaction.
      
      The proximate cause of the Assert failure is that AtEOSubXact_RelationCache
      assumed it could blow away a relcache entry without first checking that the
      entry had zero refcount.  That was a bad idea on its own terms, so add such
      a check there, and to the similar coding in AtEOXact_RelationCache.  This
      provides an independent safety measure in case there are still ways to
      provoke the situation despite the Portal-level changes.
      
      This has been broken since subtransactions were invented, so back-patch
      to all supported branches.
      
      Tom Lane and Michael Paquier
      c5454f99
    • Teodor Sigaev's avatar
      Make unaccent handle all diacritics known to Unicode, and expand ligatures correctly · 1bbd52cb
      Teodor Sigaev authored
      Add Python script for buiding unaccent.rules from Unicode data. Don't
      backpatch because unaccent changes may require tsvector/index
      rebuild.
      
      Thomas Munro <thomas.munro@enterprisedb.com>
      1bbd52cb
  6. 03 Sep, 2015 3 commits
    • Robert Haas's avatar
      Assorted code review for recent ProcArrayLock patch. · 4aec4989
      Robert Haas authored
      Post-commit review by Andres Freund discovered a couple of concurrency
      bugs in the original patch: specifically, if the leader cleared a
      follower's XID before it reached PGSemaphoreLock, the semaphore would be
      left in the wrong state; and if another process did PGSemaphoreUnlock
      for some unrelated reason, we might resume execution before the fact
      that our XID was cleared was globally visible.
      
      Also, improve the wording of some comments, rename nextClearXidElem
      to firstClearXidElem in PROC_HDR for clarity, and drop some volatile
      qualifiers that aren't necessary.
      
      Amit Kapila, reviewed and slightly revised by me.
      4aec4989
    • Fujii Masao's avatar
      Document that max_worker_processes must be high enough in standby. · 1ea5ce5c
      Fujii Masao authored
      The setting values of some parameters including max_worker_processes
      must be equal to or higher than the values on the master. However,
      previously max_worker_processes was not listed as such parameter
      in the document. So this commit adds it to that list.
      
      Back-patch to 9.4 where max_worker_processes was added.
      1ea5ce5c
    • Noah Misch's avatar
      Disable fsync throughout TAP test suites. · 7d7a103f
      Noah Misch authored
      Most suites already did so via start_test_server(), but the pg_rewind,
      pg_ctl and pg_controldata suites ran a postmaster or initdb with fsync
      enabled.  This halves the pg_rewind suite's runtime on buildfarm member
      tern.  It makes tern and that machine's other buildfarm members less
      vulnerable to noise failures from postmaster startup overrunning the 60s
      pg_ctl timeout.  Back-patch to 9.5, where pg_rewind was introduced.
      7d7a103f
  7. 02 Sep, 2015 2 commits
    • Robert Haas's avatar
      Update the SSL test suite for recent changes to TAP testing framework. · a09009e4
      Robert Haas authored
      listen_addresses needs to be handled differently now, and so does
      logging.
      
      Michael Paquier
      a09009e4
    • Teodor Sigaev's avatar
      Allow usage of huge maintenance_work_mem for GIN build. · 30bb26b5
      Teodor Sigaev authored
      Currently, in-memory posting list during GIN build process is limited 1GB
      because of using repalloc. The patch replaces call of repalloc to repalloc_huge.
      It increases limit of posting list from 180 millions
      (1GB / sizeof(ItemPointerData)) to 4 billions limited by maxcount/count fields
      in GinEntryAccumulator and subsequent calls. Check added.
      
      Also, fix accounting of allocatedMemory during build to prevent integer
      overflow with maintenance_work_mem > 4GB.
      
      Robert Abraham <robert.abraham86@googlemail.com> with additions by me
      30bb26b5
  8. 01 Sep, 2015 5 commits
  9. 31 Aug, 2015 5 commits
    • Tom Lane's avatar
      Clean up icc + ia64 situation. · 123c9d2f
      Tom Lane authored
      Some googling turned up multiple sources saying that older versions of icc
      do not accept gcc-compatible asm blocks on IA64, though asm does work on
      x86[_64].  This is apparently fixed as of icc version 12.0 or so, but that
      doesn't help us much; if we have to carry the extra implementation anyway,
      we may as well just use it for icc rather than add a compiler version test.
      
      Hence, revert commit 2c713d6e (though I
      separated the icc code from the gcc code completely, producing what seems
      cleaner code).  Document the state of affairs more explicitly, both in
      s_lock.h and postgres.c, and make some cosmetic adjustments around the
      IA64 code in s_lock.h.
      123c9d2f
    • Bruce Momjian's avatar
      docs: remove outdated note about unique indexes · 049a7799
      Bruce Momjian authored
      Patch by Josh Kupershmidt
      
      Backpatch through 9.5
      049a7799
    • Tom Lane's avatar
      Allow icc to use the same atomics infrastructure as gcc. · cf25b2a2
      Tom Lane authored
      The atomics headers were written under the impression that icc doesn't
      handle gcc-style asm blocks, but this is demonstrably false on x86_[64],
      because s_lock.h has done it that way for more than a decade.  (The jury is
      still out on whether this also works on ia64, so I'm leaving ia64-related
      code alone for the moment.)  Treat gcc and icc the same in these headers.
      This is less code and it should improve the results for icc, because we
      hadn't gotten around to providing icc-specific implementations for most
      of the atomics.
      cf25b2a2
    • Tom Lane's avatar
      Actually, it's not that hard to merge the Windows pqsignal code ... · f333204b
      Tom Lane authored
      ... just need to typedef sigset_t and provide sigemptyset/sigfillset,
      which are easy enough.
      f333204b
    • Tom Lane's avatar
      Remove theoretically-unnecessary special case for icc. · 2c713d6e
      Tom Lane authored
      Intel's icc is generally able to swallow asm blocks written for gcc.
      We have a few places that don't seem to know that, though.  Experiment
      with removing the special case for icc in ia64_get_bsp(); if the buildfarm
      likes this, I'll try more cleanup.  This is a good test case because it
      involves a "stop" notation that seems like it might not be very portable.
      2c713d6e