1. 31 Jan, 2010 1 commit
    • Magnus Hagander's avatar
      Fix race condition in win32 signal handling. · 04a4413c
      Magnus Hagander authored
      There was a race condition where the receiving pipe could be closed by the
      child thread if the main thread was pre-empted before it got a chance to
      create a new one, and the dispatch thread ran to completion during that time.
      
      One symptom of this is that rows in pg_listener could be dropped under
      heavy load.
      
      Analysis and original patch by Radu Ilie, with some small
      modifications by Magnus Hagander.
      04a4413c
  2. 30 Jan, 2010 4 commits
    • Tom Lane's avatar
      Avoid performing encoding conversion on command tag strings during EndCommand. · eb889266
      Tom Lane authored
      Since all current and foreseeable future command tags will be pure ASCII,
      there is no need to do conversion on them.  This saves a few cycles and also
      avoids polluting otherwise-pristine subtransaction memory contexts, which
      is the cause of the backend memory leak exhibited in bug #5302.  (Someday
      we'll probably want to have a better method of determining whether
      subtransaction contexts need to be kept around, but today is not that day.)
      
      Backpatch to 8.0.  The cycle-shaving aspect of this would work in 7.4
      too, but without subtransactions the memory-leak aspect doesn't apply,
      so it doesn't seem worth touching 7.4.
      eb889266
    • Tom Lane's avatar
      Fix memory leakage introduced into print_aligned_text by 8.4 changes · 07be293a
      Tom Lane authored
      (failure to free col_lineptrs[] array elements) and exacerbated in the
      current devel cycle (failure to free "wrap").  This resulted in moderate
      bloat of psql over long script runs.  Noted while testing bug #5302,
      although what the reporter was complaining of was backend-side leakage.
      07be293a
    • Tom Lane's avatar
      Fix some comments that got mangled by pgindent. · 3e51ae49
      Tom Lane authored
      3e51ae49
    • Andrew Dunstan's avatar
      Add plperl.on_perl_init setting to provide for initializing the perl library... · 85d67ccd
      Andrew Dunstan authored
      Add plperl.on_perl_init setting to provide for initializing the perl library on load. Also, handle END blocks in plperl.
      Database access is disallowed during both these operations, although it might be allowed in END blocks in future.
      
      Patch from Tim Bunce.
      85d67ccd
  3. 29 Jan, 2010 8 commits
  4. 28 Jan, 2010 9 commits
  5. 27 Jan, 2010 5 commits
    • Heikki Linnakangas's avatar
      Fix bug in wasender's xlogid boundary handling, reported by Erik Rijkers. · 83cb7da7
      Heikki Linnakangas authored
      LogwrtRqst.Write can be set to non-existent FF log segment, we mustn't
      try to send that in XLogSend().
      
      Also fix similar bug in ReadRecord(), which I just introduced in the
      ReadRecord() refactoring patch.
      83cb7da7
    • Heikki Linnakangas's avatar
      Make standby server continuously retry restoring the next WAL segment with · 1bb25580
      Heikki Linnakangas authored
      restore_command, if the connection to the primary server is lost. This
      ensures that the standby can recover automatically, if the connection is
      lost for a long time and standby falls behind so much that the required
      WAL segments have been archived and deleted in the master.
      
      This also makes standby_mode useful without streaming replication; the
      server will keep retrying restore_command every few seconds until the
      trigger file is found. That's the same basic functionality pg_standby
      offers, but without the bells and whistles.
      
      To implement that, refactor the ReadRecord/FetchRecord functions. The
      FetchRecord() function introduced in the original streaming replication
      patch is removed, and all the retry logic is now in a new function called
      XLogReadPage(). XLogReadPage() is now responsible for executing
      restore_command, launching walreceiver, and waiting for new WAL to arrive
      from primary, as required.
      
      This also changes the life cycle of walreceiver. When launched, it now only
      tries to connect to the master once, and exits if the connection fails, or
      is lost during streaming for any reason. The startup process detects the
      death, and re-launches walreceiver if necessary.
      1bb25580
    • Magnus Hagander's avatar
      Fix typo. · ab13d1e9
      Magnus Hagander authored
      Noted by Thom Brown.
      ab13d1e9
    • Magnus Hagander's avatar
      Add support for RADIUS authentication. · b3daac5a
      Magnus Hagander authored
      b3daac5a
    • Andrew Dunstan's avatar
      000416ac
  6. 26 Jan, 2010 10 commits
  7. 25 Jan, 2010 3 commits
    • Tom Lane's avatar
      Add get_bit/set_bit functions for bit strings, paralleling those for bytea, · 9507c8a1
      Tom Lane authored
      and implement OVERLAY() for bit strings and bytea.
      
      In passing also convert text OVERLAY() to a true built-in, instead of
      relying on a SQL function.
      
      Leonardo F, reviewed by Kevin Grittner
      9507c8a1
    • Heikki Linnakangas's avatar
      Add note that PREPARE TRANSACTION is for transaction managers, not · 1d1f425f
      Heikki Linnakangas authored
      regular applications. Also add a comment pointing out that tab-complition
      for PREPARE TRANSACTION is missing on purpose.
      1d1f425f
    • Tom Lane's avatar
      Apply Tcl_Init() to the "hold" interpreter created by pltcl. · e7dcfd05
      Tom Lane authored
      You might think this is unnecessary since that interpreter is never used
      to run code --- but it turns out that's wrong.  As of Tcl 8.5, the "clock"
      command (alone among builtin Tcl commands) is partially implemented by
      loaded-on-demand Tcl code, which means that it fails if there's not
      unknown-command support, and also that it's impossible to run it directly
      in a safe interpreter.  The way they get around the latter is that
      Tcl_CreateSlave() automatically sets up an alias command that forwards any
      execution of "clock" in a safe slave interpreter to its parent interpreter.
      Thus, when attempting to execute "clock" in trusted pltcl, the command
      actually executes in the "hold" interpreter, where it will fail if
      unknown-command support hasn't been introduced by sourcing the standard
      init.tcl script, which is done by Tcl_Init().  (This is a pretty dubious
      design decision on the Tcl boys' part, if you ask me ... but they didn't.)
      
      Back-patch all the way.  It's not clear that anyone would try to use ancient
      versions of pltcl with a recent Tcl, but it's not clear they wouldn't, either.
      Also add a regression test using "clock", in branches that have regression
      test support for pltcl.
      
      Per recent trouble report from Kyle Bateman.
      e7dcfd05