Skip to content
Snippets Groups Projects
  1. Jan 12, 2011
  2. Jan 01, 2011
  3. Nov 04, 2010
    • Tom Lane's avatar
      Use appendStringInfoString() where appropriate in elog.c. · 09211659
      Tom Lane authored
      The nominally equivalent call appendStringInfo(buf, "%s", str) can be
      significantly slower when str is large.  In particular, the former usage in
      EVALUATE_MESSAGE led to O(N^2) behavior when collecting a large number of
      context lines, as I found out while testing recursive functions.  The other
      changes are just neatnik-ism and seem unlikely to save anything meaningful,
      but a cycle shaved is a cycle earned.
      09211659
  4. Sep 20, 2010
  5. Aug 20, 2010
    • Tom Lane's avatar
      Bring some sanity to the trace_recovery_messages code and docs. · 79dc97a4
      Tom Lane authored
      Per gripe from Fujii Masao, though this is not exactly his proposed patch.
      Categorize as DEVELOPER_OPTIONS and set context PGC_SIGHUP, as per Fujii,
      but set the default to LOG because higher values aren't really sensible
      (see the code for trace_recovery()).  Fix the documentation to agree with
      the code and to try to explain what the variable actually does.  Get rid
      of no-op calls trace_recovery(LOG), which accomplish nothing except to
      demonstrate that this option confuses even its author.
      79dc97a4
  6. Jul 19, 2010
    • Tom Lane's avatar
      Remove unnecessary "Not safe to send CSV data" complaint from elog.c's fallback · cf5305f4
      Tom Lane authored
      path when CSV logging is configured but not yet operational.  It's sufficient
      to send the message to stderr, as we were already doing, and the "Not safe"
      gripe has already confused at least two core members ...
      
      Backpatch to 9.0, but not further --- doesn't seem appropriate to change
      this behavior in stable branches.
      cf5305f4
  7. May 08, 2010
    • Tom Lane's avatar
      Work around a subtle portability problem in use of printf %s format. · 54cd4f04
      Tom Lane authored
      Depending on which spec you read, field widths and precisions in %s may be
      counted either in bytes or characters.  Our code was assuming bytes, which
      is wrong at least for glibc's implementation, and in any case libc might
      have a different idea of the prevailing encoding than we do.  Hence, for
      portable results we must avoid using anything more complex than just "%s"
      unless the string to be printed is known to be all-ASCII.
      
      This patch fixes the cases I could find, including the psql formatting
      failure reported by Hernan Gonzalez.  In HEAD only, I also added comments
      to some places where it appears safe to continue using "%.*s".
      54cd4f04
  8. Feb 26, 2010
  9. Feb 17, 2010
  10. Jan 02, 2010
  11. Dec 19, 2009
    • Simon Riggs's avatar
      Allow read only connections during recovery, known as Hot Standby. · efc16ea5
      Simon Riggs authored
      Enabled by recovery_connections = on (default) and forcing archive recovery using a recovery.conf. Recovery processing now emulates the original transactions as they are replayed, providing full locking and MVCC behaviour for read only queries. Recovery must enter consistent state before connections are allowed, so there is a delay, typically short, before connections succeed. Replay of recovering transactions can conflict and in some cases deadlock with queries during recovery; these result in query cancellation after max_standby_delay seconds have expired. Infrastructure changes have minor effects on normal running, though introduce four new types of WAL record.
      
      New test mode "make standbycheck" allows regression tests of static command behaviour on a standby server while in recovery. Typical and extreme dynamic behaviours have been checked via code inspection and manual testing. Few port specific behaviours have been utilised, though primary testing has been on Linux only so far.
      
      This commit is the basic patch. Additional changes will follow in this release to enhance some aspects of behaviour, notably improved handling of conflicts, deadlock detection and query cancellation. Changes to VACUUM FULL are also required.
      
      Simon Riggs, with significant and lengthy review by Heikki Linnakangas, including streamlined redesign of snapshot creation and two-phase commit.
      
      Important contributions from Florian Pflug, Mark Kirkwood, Merlin Moncure, Greg Stark, Gianni Ciolli, Gabriele Bartolini, Hannu Krosing, Robert Haas, Tatsuo Ishii, Hiroyuki Yamada plus support and feedback from many other community members.
      efc16ea5
  12. Nov 29, 2009
  13. Oct 17, 2009
  14. Jul 03, 2009
  15. Jun 26, 2009
  16. Jun 11, 2009
  17. Jun 04, 2009
    • Tom Lane's avatar
      Improve the recently-added support for properly pluralized error messages · 76d4abf2
      Tom Lane authored
      by extending the ereport() API to cater for pluralization directly.  This
      is better than the original method of calling ngettext outside the elog.c
      code because (1) it avoids double translation, which wastes cycles and in
      the worst case could give a wrong result; and (2) it avoids having to use
      a different coding method in PL code than in the core backend.  The
      client-side uses of ngettext are not touched since neither of these concerns
      is very pressing in the client environment.  Per my proposal of yesterday.
      76d4abf2
  18. Mar 02, 2009
    • Tom Lane's avatar
      When we are in error recursion trouble, arrange to suppress translation and · fd9e2acc
      Tom Lane authored
      encoding conversion of any elog/ereport message being sent to the frontend.
      This generalizes a patch that I put in last October, which suppressed
      translation of only specific messages known to be associated with recursive
      can't-translate-the-message behavior.  As shown in bug #4680, we need a more
      general answer in order to have some hope of coping with broken encoding
      conversion setups.  This approach seems a good deal less klugy anyway.
      
      Patch in all supported branches.
      fd9e2acc
  19. Jan 19, 2009
  20. Jan 07, 2009
  21. Jan 01, 2009
  22. Oct 27, 2008
    • Tom Lane's avatar
      Install a more robust solution for the problem of infinite error-processing · b0169bb1
      Tom Lane authored
      recursion when we are unable to convert a localized error message to the
      client's encoding.  We've been over this ground before, but as reported by
      Ibrar Ahmed, it still didn't work in the case of conversion failures for
      the conversion-failure message itself :-(.  Fix by installing a "circuit
      breaker" that disables attempts to localize this message once we get into
      recursion trouble.
      
      Patch all supported branches, because it is in fact broken in all of them;
      though I had to add some missing translations to the older branches in
      order to expose the failure in the particular test case I was using.
      b0169bb1
  23. Oct 18, 2008
  24. Oct 09, 2008
  25. Sep 01, 2008
  26. Jul 09, 2008
    • Tom Lane's avatar
      Increase PG_SYSLOG_LIMIT (the max line length sent to syslog()) from 128 to · 6b7eebc0
      Tom Lane authored
      1024 to improve performance when sending large elog messages.  Also add a
      comment about why we use that number.
      
      Since this represents an externally visible behavior change, and might
      possibly result in portability issues, it seems best not to back-patch it.
      6b7eebc0
    • Tom Lane's avatar
      Fix performance bug in write_syslog(): the code to preferentially break the · 37933102
      Tom Lane authored
      log message at newlines cost O(N^2) for very long messages with few or no
      newlines.  For messages in the megabyte range this became the dominant cost.
      Per gripe from Achilleas Mantzios.
      
      Patch all the way back, since this is a safe change with no portability
      risks.  I am also thinking of increasing PG_SYSLOG_LIMIT, but that should
      be done separately.
      37933102
  27. Mar 24, 2008
  28. Mar 10, 2008
    • Magnus Hagander's avatar
      Implement enum type for guc parameters, and convert a couple of existing · 52a8d4f8
      Magnus Hagander authored
      variables to it. More need to be converted, but I wanted to get this in
      before it conflicts with too much...
      
      Other than just centralising the text-to-int conversion for parameters,
      this allows the pg_settings view to contain a list of available options
      and allows an error hint to show what values are allowed.
      52a8d4f8
  29. Jan 01, 2008
  30. Dec 11, 2007
  31. Nov 15, 2007
  32. Sep 27, 2007
  33. Sep 05, 2007
    • Tom Lane's avatar
      Implement lazy XID allocation: transactions that do not modify any database · 295e6398
      Tom Lane authored
      rows will normally never obtain an XID at all.  We already did things this way
      for subtransactions, but this patch extends the concept to top-level
      transactions.  In applications where there are lots of short read-only
      transactions, this should improve performance noticeably; not so much from
      removal of the actual XID-assignments, as from reduction of overhead that's
      driven by the rate of XID consumption.  We add a concept of a "virtual
      transaction ID" so that active transactions can be uniquely identified even
      if they don't have a regular XID.  This is a much lighter-weight concept:
      uniqueness of VXIDs is only guaranteed over the short term, and no on-disk
      record is made about them.
      
      Florian Pflug, with some editorialization by Tom.
      295e6398
  34. Aug 23, 2007
  35. Aug 19, 2007
  36. Aug 04, 2007
    • Tom Lane's avatar
      Fix crash caused by log_timezone patch if we attempt to emit any elog messages · 4fd8d6b3
      Tom Lane authored
      between the setting of log_line_prefix and the setting of log_timezone.  We
      can't realistically set log_timezone any earlier than we do now, so the best
      behavior seems to be to use GMT zone if any timestamps are to be logged during
      early startup.  Create a dummy zone variable with a minimal definition of GMT
      (in particular it will never know about leap seconds), so that we can set it
      up without reference to any external files.
      4fd8d6b3
    • Tom Lane's avatar
      Switch over to using the src/timezone functions for formatting timestamps · bdd6b622
      Tom Lane authored
      displayed in the postmaster log.  This avoids Windows-specific problems with
      localized time zone names that are in the wrong encoding, and generally seems
      like a good idea to forestall other potential platform-dependent issues.
      To preserve the existing behavior that all backends will log in the same time
      zone, create a new GUC variable log_timezone that can only be changed on a
      system-wide basis, and reference log-related calculations to that zone instead
      of the TimeZone variable.
      
      This fixes the issue reported by Hiroshi Saito that timestamps printed by
      xlog.c startup could be improperly localized on Windows.  We still need a
      simpler patch for that problem in the back branches, however.
      bdd6b622
Loading