1. 19 Jul, 2007 2 commits
  2. 14 Jun, 2007 1 commit
  3. 07 Jun, 2007 1 commit
    • 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
  4. 04 May, 2007 1 commit
    • 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
  5. 02 May, 2007 1 commit
    • 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
  6. 02 Mar, 2007 1 commit
  7. 11 Feb, 2007 1 commit
  8. 20 Jan, 2007 2 commits
  9. 05 Jan, 2007 1 commit
  10. 28 Nov, 2006 1 commit
  11. 21 Nov, 2006 2 commits
    • 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
  12. 01 Oct, 2006 1 commit
  13. 27 Sep, 2006 1 commit
  14. 14 Jul, 2006 1 commit
  15. 13 Jul, 2006 1 commit
  16. 11 Jul, 2006 1 commit
  17. 20 Jun, 2006 1 commit
    • 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
  18. 05 Mar, 2006 1 commit
  19. 22 Nov, 2005 1 commit
  20. 05 Nov, 2005 1 commit
    • 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
  21. 03 Nov, 2005 1 commit
  22. 15 Oct, 2005 1 commit
  23. 14 Oct, 2005 2 commits
    • 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
  24. 12 Aug, 2005 1 commit
    • 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
  25. 10 Jun, 2005 2 commits
    • Tom Lane's avatar
      Adjust comment about %t and %s to cover %m as well. Some trivial · 111e29ef
      Tom Lane authored
      code beautification too.
      111e29ef
    • Neil Conway's avatar
      Implement two new special variables in PL/PgSQL: SQLSTATE and SQLERRM. · d46bc444
      Neil Conway authored
      These contain the SQLSTATE and error message of the current exception,
      respectively. They are scope-local variables that are only defined
      in exception handlers (so attempting to reference them outside an
      exception handler is an error). Update the regression tests and the
      documentation.
      
      Also, do some minor related cleanup: export an unpack_sql_state()
      function from the backend and use it to unpack a SQLSTATE into a
      string, and add a free_var() function to pl_exec.c
      
      Original patch from Pavel Stehule, review by Neil Conway.
      d46bc444
  26. 09 Jun, 2005 1 commit
  27. 12 Mar, 2005 1 commit
  28. 27 Feb, 2005 1 commit
  29. 22 Feb, 2005 1 commit
  30. 31 Dec, 2004 1 commit
    • 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
  31. 09 Oct, 2004 2 commits
  32. 07 Oct, 2004 1 commit
  33. 22 Sep, 2004 1 commit
  34. 05 Sep, 2004 1 commit
    • 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