Skip to content
Snippets Groups Projects
  1. Sep 27, 2007
  2. 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
  3. Aug 23, 2007
  4. Aug 19, 2007
  5. 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
  6. Aug 03, 2007
  7. Jul 22, 2007
    • Tom Lane's avatar
      Fix elog.c to avoid infinite recursion (leading to backend crash) when · a0dab332
      Tom Lane authored
      log_min_error_statement is active and there is some problem in logging the
      current query string; for example, that it's too long to include in the log
      message without running out of memory.  This problem has existed since the
      log_min_error_statement feature was introduced.  No doubt the reason it
      wasn't detected long ago is that 8.2 is the first release that defaults
      log_min_error_statement to less than PANIC level.
      Per report from Bill Moran.
      a0dab332
  8. Jul 19, 2007
  9. Jun 14, 2007
  10. Jun 07, 2007
    • Tom Lane's avatar
      Redefine IsTransactionState() to only return true for TRANS_INPROGRESS state, · 6d6d14b6
      Tom Lane authored
      which is the only state in which it's safe to initiate database queries.
      It turns out that all but two of the callers thought that's what it meant;
      and the other two were using it as a proxy for "will GetTopTransactionId()
      return a nonzero XID"?  Since it was in fact an unreliable guide to that,
      make those two just invoke GetTopTransactionId() always, then deal with a
      zero result if they get one.
      6d6d14b6
  11. May 04, 2007
    • Tom Lane's avatar
      A few fixups in error handling: mark pg_re_throw() as noreturn for gcc, · 79ca7ffe
      Tom Lane authored
      and for other compilers, insert a dummy exit() call so that they understand
      PG_RE_THROW() doesn't return.  Insert fflush(stderr) in ExceptionalCondition,
      per recent buildfarm evidence that that might not happen automatically on some
      platforms.  And const-ify ExceptionalCondition's declaration while at it.
      79ca7ffe
  12. May 02, 2007
    • Tom Lane's avatar
      Fix oversight in PG_RE_THROW processing: it's entirely possible that there · 88f1fd29
      Tom Lane authored
      isn't any place to throw the error to.  If so, we should treat the error
      as FATAL, just as we would have if it'd been thrown outside the PG_TRY
      block to begin with.
      
      Although this is clearly a *potential* source of bugs, it is not clear
      at the moment whether it is an *actual* source of bugs; there may not
      presently be any PG_TRY blocks in code that can be reached with no outer
      longjmp catcher.  So for the moment I'm going to be conservative and not
      back-patch this.  The change breaks ABI for users of PG_RE_THROW and hence
      might create compatibility problems for loadable modules, so we should not
      put it into released branches without proof that it's needed.
      88f1fd29
  13. Mar 03, 2007
  14. Feb 11, 2007
  15. Jan 20, 2007
  16. Jan 05, 2007
  17. Nov 28, 2006
  18. Nov 21, 2006
    • Tom Lane's avatar
      Suppress timezone (%Z) part of timestamp display when running on Windows, · 5fc2d7e4
      Tom Lane authored
      because on that platform strftime produces localized zone names in varying
      encodings.  Even though it's only in a comment, this can cause encoding
      errors when reloading the dump script.  Per suggestion from Andreas
      Seltenreich.  Also, suppress %Z on Windows in the %s escape of
      log_line_prefix ... not sure why this one is different from the other two,
      but it shouldn't be.
      5fc2d7e4
    • Tom Lane's avatar
      Adjust elog.c so that elog(FATAL) exits (including cases where ERROR is · e82d9e62
      Tom Lane authored
      promoted to FATAL) end in exit(1) not exit(0).  Then change the postmaster to
      allow exit(1) without a system-wide panic, but not for the startup subprocess
      or the bgwriter.  There were a couple of places that were using exit(1) to
      deliberately force a system-wide panic; adjust these to be exit(2) instead.
      This fixes the problem noted back in July that if the startup process exits
      with elog(ERROR), the postmaster would think everything is hunky-dory and
      proceed to start up.  Alternative solutions such as trying to run the entire
      startup process as a critical section seem less clean, primarily because of
      the fact that a fair amount of startup code is shared by all postmaster
      children in the EXEC_BACKEND case.  We'd need an ugly special case somewhere
      near the head of main.c to make it work if it's the child process's
      responsibility to determine what happens; and what's the point when the
      postmaster already treats different children differently?
      e82d9e62
  19. Oct 02, 2006
  20. Sep 27, 2006
  21. Jul 14, 2006
  22. Jul 13, 2006
  23. Jul 11, 2006
  24. Jun 21, 2006
    • Tom Lane's avatar
      Remove redundant gettimeofday() calls to the extent practical without · 27c3e3de
      Tom Lane authored
      changing semantics too much.  statement_timestamp is now set immediately
      upon receipt of a client command message, and the various places that used
      to do their own gettimeofday() calls to mark command startup are referenced
      to that instead.  I have also made stats_command_string use that same
      value for pg_stat_activity.query_start for both the command itself and
      its eventual replacement by <IDLE> or <idle in transaction>.  There was
      some debate about that, but no argument that seemed convincing enough to
      justify an extra gettimeofday() call.
      27c3e3de
  25. Mar 05, 2006
  26. Nov 22, 2005
  27. Nov 05, 2005
    • Tom Lane's avatar
      Repair an error introduced by log_line_prefix patch: it is not acceptable · 48052de7
      Tom Lane authored
      to assume that the string pointer passed to set_ps_display is good forever.
      There's no need to anyway since ps_status.c itself saves the string, and
      we already had an API (get_ps_display) to return it.
      I believe this explains Jim Nasby's report of intermittent crashes in
      elog.c when %i format code is in use in log_line_prefix.
      While at it, repair a previously unnoticed problem: on some platforms such as
      Darwin, the string returned by get_ps_display was blank-padded to the maximum
      length, meaning that lock.c's attempt to append " waiting" to it never worked.
      48052de7
  28. Nov 03, 2005
  29. Oct 15, 2005
  30. Oct 14, 2005
    • Tom Lane's avatar
      Fix syslog bug: if any messages are emitted to write_syslog before · abd3f43b
      Tom Lane authored
      the facility has been set, the facility gets set to LOCAL0 and cannot
      be changed later.  This seems reasonably plausible to happen, particularly
      at higher debug log levels, though I am not certain it explains Han Holl's
      recent report.  Easiest fix is to teach the code how to change the value
      on-the-fly, which is nicer anyway.  I made the settings PGC_SIGHUP to
      conform with log_destination.
      abd3f43b
    • Tom Lane's avatar
      Pass a strdup'd ident string to openlog(), to ensure that reallocation · 4aa0d70f
      Tom Lane authored
      of GUC memory doesn't cause us to start emitting a bogus ident string.
      Per report from Han Holl.  Also some trivial code cleanup in write_syslog.
      4aa0d70f
  31. Aug 12, 2005
    • Bruce Momjian's avatar
      This patch fixes the event type used to log output from the · ed63689b
      Bruce Momjian authored
      stderr-in-service or output-from-syslogger-in-service code. Previously
      everything was flagged as ERRORs there, which caused all instances to
      log "LOG: logger shutting down" as error...
      
      Please apply for 8.1. I'd also like it considered for 8.0 since logging
      non-errors as errors can be cause for alarm amongst people who actually
      look at their logs...
      
      Magnus Hagander
      ed63689b
  32. Jun 10, 2005
Loading