Skip to content
Snippets Groups Projects
  1. Jun 14, 2007
  2. 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
  3. 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
  4. 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
  5. Mar 03, 2007
  6. Feb 11, 2007
  7. Jan 20, 2007
  8. Jan 05, 2007
  9. Nov 28, 2006
  10. 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
  11. Oct 02, 2006
  12. Sep 27, 2006
  13. Jul 14, 2006
  14. Jul 13, 2006
  15. Jul 11, 2006
  16. 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
  17. Mar 05, 2006
  18. Nov 22, 2005
  19. 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
  20. Nov 03, 2005
  21. Oct 15, 2005
  22. 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
  23. 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
  24. Jun 10, 2005
  25. Mar 12, 2005
  26. Feb 27, 2005
  27. Feb 22, 2005
  28. Dec 31, 2004
    • PostgreSQL Daemon's avatar
      · 2ff50159
      PostgreSQL Daemon authored
      Tag appropriate files for rc3
      
      Also performed an initial run through of upgrading our Copyright date to
      extend to 2005 ... first run here was very simple ... change everything
      where: grep 1996-2004 && the word 'Copyright' ... scanned through the
      generated list with 'less' first, and after, to make sure that I only
      picked up the right entries ...
      2ff50159
  29. Oct 09, 2004
  30. Oct 07, 2004
  31. Sep 22, 2004
  32. Sep 05, 2004
    • Tom Lane's avatar
      On further consideration, there's another problem here: the existing · 1a86e6ea
      Tom Lane authored
      elog() emulation code always calls errstart with ERROR error level.
      This means that a recursive error call triggered by elog would do
      MemoryContextReset(ErrorContext), whether or not this was actually
      appropriate.  I'm surprised we haven't seen this in the field...
      1a86e6ea
    • Tom Lane's avatar
      Tweak elog.c's logic for promoting errors into more severe errors. · cefb4b14
      Tom Lane authored
      Messages of less than ERROR severity should never be promoted (this
      fixes Gaetano Mendola's problem with a COMMERROR becoming a PANIC,
      and is obvious in hindsight anyway).  Do all promotion in errstart
      not errfinish, to ensure that output decisions are made correctly;
      the former coding could suppress logging of promoted errors, which
      doesn't seem like a good idea.  Eliminate some redundant code too.
      cefb4b14
Loading