Skip to content
Snippets Groups Projects
  1. Mar 22, 2007
  2. Mar 13, 2007
    • Tom Lane's avatar
      First phase of plan-invalidation project: create a plan cache management · b9527e98
      Tom Lane authored
      module and teach PREPARE and protocol-level prepared statements to use it.
      In service of this, rearrange utility-statement processing so that parse
      analysis does not assume table schemas can't change before execution for
      utility statements (necessary because we don't attempt to re-acquire locks
      for utility statements when reusing a stored plan).  This requires some
      refactoring of the ProcessUtility API, but it ends up cleaner anyway,
      for instance we can get rid of the QueryContext global.
      
      Still to do: fix up SPI and related code to use the plan cache; I'm tempted to
      try to make SQL functions use it too.  Also, there are at least some aspects
      of system state that we want to ensure remain the same during a replan as in
      the original processing; search_path certainly ought to behave that way for
      instance, and perhaps there are others.
      b9527e98
  3. Mar 03, 2007
  4. Feb 20, 2007
    • Tom Lane's avatar
      Remove the Query structure from the executor's API. This allows us to stop · 9cbd0c15
      Tom Lane authored
      storing mostly-redundant Query trees in prepared statements, portals, etc.
      To replace Query, a new node type called PlannedStmt is inserted by the
      planner at the top of a completed plan tree; this carries just the fields of
      Query that are still needed at runtime.  The statement lists kept in portals
      etc. now consist of intermixed PlannedStmt and bare utility-statement nodes
      --- no Query.  This incidentally allows us to remove some fields from Query
      and Plan nodes that shouldn't have been there in the first place.
      
      Still to do: simplify the execution-time range table; at the moment the
      range table passed to the executor still contains Query trees for subqueries.
      
      initdb forced due to change of stored rules.
      9cbd0c15
  5. Feb 17, 2007
  6. Feb 16, 2007
    • Alvaro Herrera's avatar
      Restructure autovacuum in two processes: a dummy process, which runs · 18206509
      Alvaro Herrera authored
      continuously, and requests vacuum runs of "autovacuum workers" to postmaster.
      The workers do the actual vacuum work.  This allows for future improvements,
      like allowing multiple autovacuum jobs running in parallel.
      
      For now, the code keeps the original behavior of having a single autovac
      process at any time by sleeping until the previous worker has finished.
      18206509
  7. Feb 10, 2007
  8. Jan 05, 2007
  9. Jan 04, 2007
  10. Dec 08, 2006
  11. Nov 21, 2006
    • Tom Lane's avatar
      On systems that have setsid(2) (which should be just about everything except · 3ad0728c
      Tom Lane authored
      Windows), arrange for each postmaster child process to be its own process
      group leader, and deliver signals SIGINT, SIGTERM, SIGQUIT to the whole
      process group not only the direct child process.  This provides saner behavior
      for archive and recovery scripts; in particular, it's possible to shut down a
      warm-standby recovery server using "pg_ctl stop -m immediate", since delivery
      of SIGQUIT to the startup subprocess will result in killing the waiting
      recovery_command.  Also, this makes Query Cancel and statement_timeout apply
      to scripts being run from backends via system().  (There is no support in the
      core backend for that, but it's widely done using untrusted PLs.)  Per gripe
      from Stephen Harris and subsequent discussion.
      3ad0728c
    • 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. Oct 19, 2006
  13. Oct 08, 2006
  14. Oct 07, 2006
  15. Oct 04, 2006
  16. Sep 13, 2006
  17. Sep 08, 2006
    • Tom Lane's avatar
      Tweak the behavior of log_duration as proposed by Guillaume Smet: rather · b59d31c2
      Tom Lane authored
      than being equivalent to setting log_min_duration_statement to zero, this
      option now forces logging of all query durations, but doesn't force logging
      of query text.  Also, add duration logging coverage for fastpath function
      calls.
      b59d31c2
    • Tom Lane's avatar
      Clean up logging for extended-query-protocol operations, as per my recent · 893632be
      Tom Lane authored
      proposal.  Parameter logging works even for binary-format parameters, and
      logging overhead is avoided when disabled.
      
      log_statement = all output for the src/test/examples/testlibpq3.c example
      now looks like
      
      LOG:  statement: execute <unnamed>: SELECT * FROM test1 WHERE t = $1
      DETAIL:  parameters: $1 = 'joe''s place'
      LOG:  statement: execute <unnamed>: SELECT * FROM test1 WHERE i = $1::int4
      DETAIL:  parameters: $1 = '2'
      
      and log_min_duration_statement = 0 results in
      
      LOG:  duration: 2.431 ms  parse <unnamed>: SELECT * FROM test1 WHERE t = $1
      LOG:  duration: 2.335 ms  bind <unnamed> to <unnamed>: SELECT * FROM test1 WHERE t = $1
      DETAIL:  parameters: $1 = 'joe''s place'
      LOG:  duration: 0.394 ms  execute <unnamed>: SELECT * FROM test1 WHERE t = $1
      DETAIL:  parameters: $1 = 'joe''s place'
      LOG:  duration: 1.251 ms  parse <unnamed>: SELECT * FROM test1 WHERE i = $1::int4
      LOG:  duration: 0.566 ms  bind <unnamed> to <unnamed>: SELECT * FROM test1 WHERE i = $1::int4
      DETAIL:  parameters: $1 = '2'
      LOG:  duration: 0.173 ms  execute <unnamed>: SELECT * FROM test1 WHERE i = $1::int4
      DETAIL:  parameters: $1 = '2'
      
      (This example demonstrates the folly of ignoring parse/bind steps for duration
      logging purposes, BTW.)
      
      Along the way, create a less ad-hoc mechanism for determining which commands
      are logged by log_statement = mod and log_statement = ddl.  The former coding
      was actually missing quite a few things that look like ddl to me, and it
      did not handle EXECUTE or extended query protocol correctly at all.
      
      This commit does not do anything about the question of whether log_duration
      should be removed or made less redundant with log_min_duration_statement.
      893632be
  18. Sep 06, 2006
    • Tom Lane's avatar
      Change processing of extended-Query mode so that an unnamed statement · 5983a1aa
      Tom Lane authored
      that has parameters is always planned afresh for each Bind command,
      treating the parameter values as constants in the planner.  This removes
      the performance penalty formerly often paid for using out-of-line
      parameters --- with this definition, the planner can do constant folding,
      LIKE optimization, etc.  After a suggestion by Andrew@supernews.
      5983a1aa
  19. Sep 03, 2006
  20. Sep 02, 2006
  21. Aug 30, 2006
  22. Aug 29, 2006
  23. Aug 15, 2006
    • Tom Lane's avatar
      Add server support for "plugin" libraries that can be used for add-on tasks · abc3120e
      Tom Lane authored
      such as debugging and performance measurement.  This consists of two features:
      a table of "rendezvous variables" that allows separately-loaded shared
      libraries to communicate, and a new GUC setting "local_preload_libraries"
      that allows libraries to be loaded into specific sessions without explicit
      cooperation from the client application.  To make local_preload_libraries
      as flexible as possible, we do not restrict its use to superusers; instead,
      it is restricted to load only libraries stored in $libdir/plugins/.  The
      existing LOAD command has also been modified to allow non-superusers to
      LOAD libraries stored in this directory.
      
      This patch also renames the existing GUC variable preload_libraries to
      shared_preload_libraries (after a suggestion by Simon Riggs) and does some
      code refactoring in dfmgr.c to improve clarity.
      
      Korry Douglas, with a little help from Tom Lane.
      abc3120e
  24. Aug 14, 2006
  25. Aug 10, 2006
  26. Aug 08, 2006
    • Bruce Momjian's avatar
      For protocol-level prepare/bind/execute: · 3716f90c
      Bruce Momjian authored
      	o  print user name for all
      	o  print portal name if defined for all
      	o  print query for all
      	o  reduce log_statement header to single keyword
      	o  print bind parameters as DETAIL if text mode
      3716f90c
  27. Aug 06, 2006
  28. Aug 04, 2006
  29. Jul 29, 2006
    • Tom Lane's avatar
      Adjust initialization sequence for timezone_abbreviations so that · 033a477e
      Tom Lane authored
      it's handled just about like timezone; in particular, don't try
      to read anything during InitializeGUCOptions.  Should solve current
      startup failure on Windows, and avoid wasted cycles if a nondefault
      setting is specified in postgresql.conf too.  Possibly we need to
      think about a more general solution for handling 'expensive to set'
      GUC options.
      033a477e
  30. Jul 14, 2006
  31. Jul 13, 2006
  32. Jun 28, 2006
Loading