1. 10 Jul, 2006 1 commit
    • Alvaro Herrera's avatar
      Improve vacuum code to track minimum Xids per table instead of per database. · d4cef0aa
      Alvaro Herrera authored
      To this end, add a couple of columns to pg_class, relminxid and relvacuumxid,
      based on which we calculate the pg_database columns after each vacuum.
      
      We now force all databases to be vacuumed, even template ones.  A backend
      noticing too old a database (meaning pg_database.datminxid is in danger of
      falling behind Xid wraparound) will signal the postmaster, which in turn will
      start an autovacuum iteration to process the offending database.  In principle
      this is only there to cope with frozen (non-connectable) databases without
      forcing users to set them to connectable, but it could force regular user
      database to go through a database-wide vacuum at any time.  Maybe we should
      warn users about this somehow.  Of course the real solution will be to use
      autovacuum all the time ;-)
      
      There are some additional improvements we could have in this area: for example
      the vacuum code could be smarter about not updating pg_database for each table
      when called by autovacuum, and do it only once the whole autovacuum iteration
      is done.
      
      I updated the system catalogs documentation, but I didn't modify the
      maintenance section.  Also having some regression tests for this would be nice
      but it's not really a very straightforward thing to do.
      
      Catalog version bumped due to system catalog changes.
      d4cef0aa
  2. 05 Mar, 2006 1 commit
  3. 22 Nov, 2005 1 commit
  4. 29 Oct, 2005 1 commit
  5. 15 Oct, 2005 1 commit
  6. 22 Aug, 2005 1 commit
  7. 12 Aug, 2005 1 commit
    • Tom Lane's avatar
      Solve the problem of OID collisions by probing for duplicate OIDs · 721e5378
      Tom Lane authored
      whenever we generate a new OID.  This prevents occasional duplicate-OID
      errors that can otherwise occur once the OID counter has wrapped around.
      Duplicate relfilenode values are also checked for when creating new
      physical files.  Per my recent proposal.
      721e5378
  8. 19 May, 2005 1 commit
  9. 13 Apr, 2005 1 commit
    • Tom Lane's avatar
      Simplify initdb-time assignment of OIDs as I proposed yesterday, and · 2193a856
      Tom Lane authored
      avoid encroaching on the 'user' range of OIDs by allowing automatic
      OID assignment to use values below 16k until we reach normal operation.
      
      initdb not forced since this doesn't make any incompatible change;
      however a lot of stuff will have different OIDs after your next initdb.
      2193a856
  10. 20 Feb, 2005 2 commits
    • 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
    • Tom Lane's avatar
      Add code to prevent transaction ID wraparound by enforcing a safe limit · 60b2444c
      Tom Lane authored
      in GetNewTransactionId().  Since the limit value has to be computed
      before we run any real transactions, this requires adding code to database
      startup to scan pg_database and determine the oldest datfrozenxid.
      This can conveniently be combined with the first stage of an attack on
      the problem that the 'flat file' copies of pg_shadow and pg_group are
      not properly updated during WAL recovery.  The code I've added to
      startup resides in a new file src/backend/utils/init/flatfiles.c, and
      it is responsible for rewriting the flat files as well as initializing
      the XID wraparound limit value.  This will eventually allow us to get
      rid of GetRawDatabaseInfo too, but we'll need an initdb so we can add
      a trigger to pg_database.
      60b2444c
  11. 01 Jan, 2005 1 commit
  12. 29 Aug, 2004 2 commits
  13. 01 Aug, 2004 1 commit
    • Tom Lane's avatar
      Some mop-up work for savepoints (nested transactions). Store a small · efcaf1e8
      Tom Lane authored
      number of active subtransaction XIDs in each backend's PGPROC entry,
      and use this to avoid expensive probes into pg_subtrans during
      TransactionIdIsInProgress.  Extend EOXactCallback API to allow add-on
      modules to get control at subxact start/end.  (This is deliberately
      not compatible with the former API, since any uses of that API probably
      need manual review anyway.)  Add basic reference documentation for
      SAVEPOINT and related commands.  Minor other cleanups to check off some
      of the open issues for subtransactions.
      Alvaro Herrera and Tom Lane.
      efcaf1e8
  14. 01 Jul, 2004 1 commit
  15. 26 Jan, 2004 1 commit
  16. 07 Jan, 2004 1 commit
  17. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  18. 04 Aug, 2003 1 commit
  19. 04 Sep, 2002 1 commit
  20. 11 Jun, 2002 1 commit
    • Jan Wieck's avatar
      Katherine Ward wrote: · 469cb65a
      Jan Wieck authored
      > Changes to avoid collisions with WIN32 & MFC names...
      > 1.  Renamed:
      >       a.  PROC => PGPROC
      >       b.  GetUserName() => GetUserNameFromId()
      >       c.  GetCurrentTime() => GetCurrentDateTime()
      >       d.  IGNORE => IGNORE_DTF in include/utils/datetime.h & utils/adt/datetim
      >
      > 2.  Added _P to some lex/yacc tokens:
      >       CONST, CHAR, DELETE, FLOAT, GROUP, IN, OUT
      
      Jan
      469cb65a
  21. 25 May, 2002 1 commit
  22. 28 Oct, 2001 1 commit
  23. 25 Oct, 2001 1 commit
  24. 29 Sep, 2001 1 commit
    • Tom Lane's avatar
      Implement new 'lightweight lock manager' that's intermediate between · 499abb0c
      Tom Lane authored
      existing lock manager and spinlocks: it understands exclusive vs shared
      lock but has few other fancy features.  Replace most uses of spinlocks
      with lightweight locks.  All remaining uses of spinlocks have very short
      lock hold times (a few dozen instructions), so tweak spinlock backoff
      code to work efficiently given this assumption.  All per my proposal on
      pghackers 26-Sep-01.
      499abb0c
  25. 25 Aug, 2001 1 commit
    • Tom Lane's avatar
      Replace implementation of pg_log as a relation accessed through the · 2589735d
      Tom Lane authored
      buffer manager with 'pg_clog', a specialized access method modeled
      on pg_xlog.  This simplifies startup (don't need to play games to
      open pg_log; among other things, OverrideTransactionSystem goes away),
      should improve performance a little, and opens the door to recycling
      commit log space by removing no-longer-needed segments of the commit
      log.  Actual recycling is not there yet, but I felt I should commit
      this part separately since it'd still be useful if we chose not to
      do transaction ID wraparound.
      2589735d
  26. 23 Aug, 2001 1 commit
  27. 10 Aug, 2001 1 commit
    • Tom Lane's avatar
      Make OIDs optional, per discussions in pghackers. WITH OIDS is still the · bf56f075
      Tom Lane authored
      default, but OIDS are removed from many system catalogs that don't need them.
      Some interesting side effects: TOAST pointers are 20 bytes not 32 now;
      pg_description has a three-column key instead of one.
      
      Bugs fixed in passing: BINARY cursors work again; pg_class.relhaspkey
      has some usefulness; pg_dump dumps comments on indexes, rules, and
      triggers in a valid order.
      
      initdb forced.
      bf56f075
  28. 16 Jul, 2001 1 commit
    • Tom Lane's avatar
      Improve documentation about reasoning behind the order of operations · ed5c4e4a
      Tom Lane authored
      in GetSnapshotData, GetNewTransactionId, CommitTransaction, AbortTransaction,
      etc.  Correct race condition in transaction status testing in
      HeapTupleSatisfiesVacuum --- this wasn't important for old VACUUM with
      exclusive lock on its table, but it sure is important now.  All per
      pghackers discussion 7/11/01 and 7/12/01.
      ed5c4e4a
  29. 12 Jul, 2001 1 commit
  30. 25 May, 2001 2 commits
  31. 22 Mar, 2001 1 commit
  32. 18 Mar, 2001 1 commit
  33. 13 Mar, 2001 1 commit
    • Tom Lane's avatar
      XLOG (and related) changes: · 4d14fe00
      Tom Lane authored
      * Store two past checkpoint locations, not just one, in pg_control.
        On startup, we fall back to the older checkpoint if the newer one
        is unreadable.  Also, a physical copy of the newest checkpoint record
        is kept in pg_control for possible use in disaster recovery (ie,
        complete loss of pg_xlog).  Also add a version number for pg_control
        itself.  Remove archdir from pg_control; it ought to be a GUC
        parameter, not a special case (not that it's implemented yet anyway).
      
      * Suppress successive checkpoint records when nothing has been entered
        in the WAL log since the last one.  This is not so much to avoid I/O
        as to make it actually useful to keep track of the last two
        checkpoints.  If the things are right next to each other then there's
        not a lot of redundancy gained...
      
      * Change CRC scheme to a true 64-bit CRC, not a pair of 32-bit CRCs
        on alternate bytes.  Polynomial borrowed from ECMA DLT1 standard.
      
      * Fix XLOG record length handling so that it will work at BLCKSZ = 32k.
      
      * Change XID allocation to work more like OID allocation.  (This is of
        dubious necessity, but I think it's a good idea anyway.)
      
      * Fix a number of minor bugs, such as off-by-one logic for XLOG file
        wraparound at the 4 gig mark.
      
      * Add documentation and clean up some coding infelicities; move file
        format declarations out to include files where planned contrib
        utilities can get at them.
      
      * Checkpoint will now occur every CHECKPOINT_SEGMENTS log segments or
        every CHECKPOINT_TIMEOUT seconds, whichever comes first.  It is also
        possible to force a checkpoint by sending SIGUSR1 to the postmaster
        (undocumented feature...)
      
      * Defend against kill -9 postmaster by storing shmem block's key and ID
        in postmaster.pid lockfile, and checking at startup to ensure that no
        processes are still connected to old shmem block (if it still exists).
      
      * Switch backends to accept SIGQUIT rather than SIGUSR1 for emergency
        stop, for symmetry with postmaster and xlog utilities.  Clean up signal
        handling in bootstrap.c so that xlog utilities launched by postmaster
        will react to signals better.
      
      * Standalone bootstrap now grabs lockfile in target directory, as added
        insurance against running it in parallel with live postmaster.
      4d14fe00
  34. 24 Jan, 2001 1 commit
  35. 30 Nov, 2000 1 commit
  36. 20 Nov, 2000 1 commit
  37. 08 Nov, 2000 1 commit
    • Tom Lane's avatar
      Make DROP TABLE rollback-able: postpone physical file delete until commit. · 3908473c
      Tom Lane authored
      (WAL logging for this is not done yet, however.)  Clean up a number of really
      crufty things that are no longer needed now that DROP behaves nicely.  Make
      temp table mapper do the right things when drop or rename affecting a temp
      table is rolled back.  Also, remove "relation modified while in use" error
      check, in favor of locking tables at first reference and holding that lock
      throughout the statement.
      3908473c