1. 13 Mar, 2007 1 commit
    • 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
  2. 15 Feb, 2007 1 commit
    • 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
  3. 05 Jan, 2007 1 commit
  4. 05 Nov, 2006 1 commit
    • Tom Lane's avatar
      Fix recently-understood problems with handling of XID freezing, particularly · 48188e16
      Tom Lane authored
      in PITR scenarios.  We now WAL-log the replacement of old XIDs with
      FrozenTransactionId, so that such replacement is guaranteed to propagate to
      PITR slave databases.  Also, rather than relying on hint-bit updates to be
      preserved, pg_clog is not truncated until all instances of an XID are known to
      have been replaced by FrozenTransactionId.  Add new GUC variables and
      pg_autovacuum columns to allow management of the freezing policy, so that
      users can trade off the size of pg_clog against the amount of freezing work
      done.  Revise the already-existing code that forces autovacuum of tables
      approaching the wraparound point to make it more bulletproof; also, revise the
      autovacuum logic so that anti-wraparound vacuuming is done per-table rather
      than per-database.  initdb forced because of changes in pg_class, pg_database,
      and pg_autovacuum catalogs.  Heikki Linnakangas, Simon Riggs, and Tom Lane.
      48188e16
  5. 04 Oct, 2006 1 commit
  6. 18 Sep, 2006 1 commit
    • Tom Lane's avatar
      Add built-in userlock manipulation functions to replace the former · 9b4cda0d
      Tom Lane authored
      contrib functionality.  Along the way, remove the USER_LOCKS configuration
      symbol, since it no longer makes any sense to try to compile that out.
      No user documentation yet ... mmoncure has promised to write some.
      Thanks to Abhijit Menon-Sen for creating a first draft to work from.
      9b4cda0d
  7. 13 Jul, 2006 1 commit
  8. 22 Jun, 2006 1 commit
  9. 04 May, 2006 2 commits
    • Tom Lane's avatar
      Simplify relcache startup sequence. With the new design of InitPostgres · 46287bd6
      Tom Lane authored
      it's not necessary to have three separate calls anymore.  This patch also
      fixes things so we don't try to read pg_internal.init until after we've
      obtained lock on the target database; which was fairly harmless, but it's
      certainly cleaner this way.
      46287bd6
    • Tom Lane's avatar
      Rethink the locking mechanisms used for CREATE/DROP/RENAME DATABASE. · 52667d56
      Tom Lane authored
      The former approach used ExclusiveLock on pg_database, which being a
      cluster-wide lock meant only one of these operations could proceed at
      a time; worse, it also blocked all incoming connections in ReverifyMyDatabase.
      Now that we have LockSharedObject(), we can use locks of different types
      applied to databases considered as objects.  This allows much more
      flexible management of the interlocking: two CREATE DATABASEs need not
      block each other, and need not block connections except to the template
      database being used.  Similarly DROP DATABASE doesn't block unrelated
      operations.  The locking used in flatfiles.c is also much narrower in
      scope than before.  Per recent proposal.
      52667d56
  10. 03 May, 2006 1 commit
    • Tom Lane's avatar
      Create a syscache for pg_database-indexed-by-oid, and make use of it · cb98e6fb
      Tom Lane authored
      in various places that were previously doing ad hoc pg_database searches.
      This may speed up database-related privilege checks a little bit, but
      the main motivation is to eliminate the performance reason for having
      ReverifyMyDatabase do such a lot of stuff (viz, avoiding repeat scans
      of pg_database during backend startup).  The locking reason for having
      that routine is about to go away, and it'd be good to have the option
      to break it up.
      cb98e6fb
  11. 30 Apr, 2006 2 commits
  12. 29 Mar, 2006 1 commit
    • Tom Lane's avatar
      Clean up and document the API for XLogOpenRelation and XLogReadBuffer. · 6d61cdec
      Tom Lane authored
      This commit doesn't make much functional change, but it does eliminate some
      duplicated code --- for instance, PageIsNew tests are now done inside
      XLogReadBuffer rather than by each caller.
      The GIST xlog code still needs a lot of love, but I'll worry about that
      separately.
      6d61cdec
  13. 05 Mar, 2006 1 commit
  14. 04 Jan, 2006 1 commit
  15. 22 Nov, 2005 1 commit
  16. 15 Oct, 2005 1 commit
  17. 11 Aug, 2005 1 commit
    • Tom Lane's avatar
      Autovacuum loose end mop-up. Provide autovacuum-specific vacuum cost · d90c5311
      Tom Lane authored
      delay and limit, both as global GUCs and as table-specific entries in
      pg_autovacuum.  stats_reset_on_server_start is now OFF by default,
      but a reset is forced if we did WAL replay.  XID-wrap vacuums do not
      ANALYZE, but do FREEZE if it's a template database.  Alvaro Herrera
      d90c5311
  18. 08 Aug, 2005 1 commit
    • Tom Lane's avatar
      Cause ShutdownPostgres to do a normal transaction abort during backend · 7117cd3a
      Tom Lane authored
      exit, instead of trying to take shortcuts.  Introduce some additional
      shutdown callback routines to eliminate kluges like having ProcKill
      be responsible for shutting down the buffer manager.  Ensure that the
      order of operations during shutdown is predictable and what you would
      expect given the module layering.
      7117cd3a
  19. 31 Jul, 2005 1 commit
  20. 29 Jul, 2005 1 commit
    • Tom Lane's avatar
      Clean up a number of autovacuum loose ends. Make the stats collector · 5d5f1a79
      Tom Lane authored
      track shared relations in a separate hashtable, so that operations done
      from different databases are counted correctly.  Add proper support for
      anti-XID-wraparound vacuuming, even in databases that are never connected
      to and so have no stats entries.  Miscellaneous other bug fixes.
      Alvaro Herrera, some additional fixes by Tom Lane.
      5d5f1a79
  21. 14 Jul, 2005 1 commit
  22. 04 Jul, 2005 1 commit
    • Tom Lane's avatar
      Arrange for the postmaster (and standalone backends, initdb, etc) to · eb5949d1
      Tom Lane authored
      chdir into PGDATA and subsequently use relative paths instead of absolute
      paths to access all files under PGDATA.  This seems to give a small
      performance improvement, and it should make the system more robust
      against naive DBAs doing things like moving a database directory that
      has a live postmaster in it.  Per recent discussion.
      eb5949d1
  23. 28 Jun, 2005 2 commits
    • Tom Lane's avatar
      Bring syntax of role-related commands into SQL compliance. To avoid · 0eaa36a1
      Tom Lane authored
      syntactic conflicts, both privilege and role GRANT/REVOKE commands have
      to use the same production for scanning the list of tokens that might
      eventually turn out to be privileges or role names.  So, change the
      existing GRANT/REVOKE code to expect a list of strings not pre-reduced
      AclMode values.  Fix a couple other minor issues while at it, such as
      InitializeAcl function name conflicting with a Windows system function.
      0eaa36a1
    • Tom Lane's avatar
      Replace pg_shadow and pg_group by new role-capable catalogs pg_authid · 7762619e
      Tom Lane authored
      and pg_auth_members.  There are still many loose ends to finish in this
      patch (no documentation, no regression tests, no pg_dump support for
      instance).  But I'm going to commit it now anyway so that Alvaro can
      make some progress on shared dependencies.  The catalog changes should
      be pretty much done.
      7762619e
  24. 24 Jun, 2005 1 commit
  25. 17 Jun, 2005 1 commit
  26. 19 May, 2005 1 commit
  27. 05 May, 2005 1 commit
  28. 14 Apr, 2005 1 commit
  29. 19 Mar, 2005 1 commit
  30. 18 Mar, 2005 2 commits
  31. 26 Feb, 2005 1 commit
    • Tom Lane's avatar
      Finish up the flat-files project: get rid of GetRawDatabaseInfo() hack · 0fc4ecf9
      Tom Lane authored
      in favor of looking at the flat file copy of pg_database during backend
      startup.  This should finally eliminate the various corner cases in which
      backend startup fails unexpectedly because it isn't able to distinguish
      live and dead tuples in pg_database.  Simplify locking on pg_database
      to be similar to the rules used with pg_shadow and pg_group, and eliminate
      FlushRelationBuffers operations that were used only to reduce the odds
      of failure of GetRawDatabaseInfo.
      initdb forced due to addition of a trigger to pg_database.
      0fc4ecf9
  32. 20 Feb, 2005 1 commit
    • Tom Lane's avatar
      Remove some no-longer-needed kluges for bootstrapping, in particular · 4aefe755
      Tom Lane authored
      the AMI_OVERRIDE flag.  The fact that TransactionLogFetch treats
      BootstrapTransactionId as always committed is sufficient to make
      bootstrap work, and getting rid of extra tests in heavily used code
      paths seems like a win.  The files produced by initdb are demonstrably
      the same after this change.
      4aefe755
  33. 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
  34. 14 Nov, 2004 1 commit
  35. 29 Aug, 2004 2 commits