1. 19 May, 2005 1 commit
  2. 30 Apr, 2005 1 commit
  3. 29 Apr, 2005 1 commit
    • Tom Lane's avatar
      Restructure LOCKTAG as per discussions of a couple months ago. · 3a694bb0
      Tom Lane authored
      Essentially, we shoehorn in a lockable-object-type field by taking
      a byte away from the lockmethodid, which can surely fit in one byte
      instead of two.  This allows less artificial definitions of all the
      other fields of LOCKTAG; we can get rid of the special pg_xactlock
      pseudo-relation, and also support locks on individual tuples and
      general database objects (including shared objects).  None of those
      possibilities are actually exploited just yet, however.
      
      I removed pg_xactlock from pg_class, but did not force initdb for
      that change.  At this point, relkind 's' (SPECIAL) is unused and
      could be removed entirely.
      3a694bb0
  4. 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
  5. 16 Sep, 2004 1 commit
    • Tom Lane's avatar
      Restructure subtransaction handling to reduce resource consumption, · 8f9f1986
      Tom Lane authored
      as per recent discussions.  Invent SubTransactionIds that are managed like
      CommandIds (ie, counter is reset at start of each top transaction), and
      use these instead of TransactionIds to keep track of subtransaction status
      in those modules that need it.  This means that a subtransaction does not
      need an XID unless it actually inserts/modifies rows in the database.
      Accordingly, don't assign it an XID nor take a lock on the XID until it
      tries to do that.  This saves a lot of overhead for subtransactions that
      are only used for error recovery (eg plpgsql exceptions).  Also, arrange
      to release a subtransaction's XID lock as soon as the subtransaction
      exits, in both the commit and abort cases.  This avoids holding many
      unique locks after a long series of subtransactions.  The price is some
      additional overhead in XactLockTableWait, but that seems acceptable.
      Finally, restructure the state machine in xact.c to have a more orthogonal
      set of states for subtransactions.
      8f9f1986
  6. 29 Aug, 2004 2 commits
  7. 22 Aug, 2004 1 commit
    • Tom Lane's avatar
      Tweak code so that pg_subtrans is never consulted for XIDs older than · f009c316
      Tom Lane authored
      RecentXmin (== MyProc->xmin).  This ensures that it will be safe to
      truncate pg_subtrans at RecentGlobalXmin, which should largely eliminate
      any fear of bloat.  Along the way, eliminate SubTransXidsHaveCommonAncestor,
      which isn't really needed and could not give a trustworthy result anyway
      under the lookback restriction.
      In an unrelated but nearby change, #ifdef out GetUndoRecPtr, which has
      been dead code since 2001 and seems unlikely to ever be resurrected.
      f009c316
  8. 28 Jul, 2004 1 commit
    • Tom Lane's avatar
      Fix subtransaction behavior for large objects, temp namespace, files, · 1bf3d615
      Tom Lane authored
      password/group files.  Also allow read-only subtransactions of a read-write
      parent, but not vice versa.  These are the reasonably noncontroversial
      parts of Alvaro's recent mop-up patch, plus further work on large objects
      to minimize use of the TopTransactionResourceOwner.
      1bf3d615
  9. 27 Jul, 2004 1 commit
  10. 01 Jul, 2004 1 commit
  11. 28 May, 2004 1 commit
    • Tom Lane's avatar
      Code review for EXEC_BACKEND changes. Reduce the number of #ifdefs by · 1a321f26
      Tom Lane authored
      about a third, make it work on non-Windows platforms again.  (But perhaps
      I broke the WIN32 code, since I have no way to test that.)  Fold all the
      paths that fork postmaster child processes to go through the single
      routine SubPostmasterMain, which takes care of resurrecting the state that
      would normally be inherited from the postmaster (including GUC variables).
      Clean up some places where there's no particularly good reason for the
      EXEC and non-EXEC cases to work differently.  Take care of one or two
      FIXMEs that remained in the code.
      1a321f26
  12. 01 Dec, 2003 1 commit
    • Bruce Momjian's avatar
      Try to reduce confusion about what is a lock method identifier, a lock · e7ca8674
      Bruce Momjian authored
      method control structure, or a table of control structures.
      
      . Use type LOCKMASK where an int is not a counter.
      
      . Get rid of INVALID_TABLEID, use INVALID_LOCKMETHOD instead.
      
      . Use INVALID_LOCKMETHOD instead of (LOCKMETHOD) NULL, because
        LOCKMETHOD is not a pointer.
      
      . Define and use macro LockMethodIsValid.
      
      . Rename LOCKMETHOD to LOCKMETHODID.
      
      . Remove global variable LongTermTableId in lmgr.c, because it is
        never used.
      
      . Make LockTableId static in lmgr.c, because it is used nowhere else.
        Why not remove it and use DEFAULT_LOCKMETHOD?
      
      . Rename the lock method control structure from LOCKMETHODTABLE to
        LockMethodData.  Introduce a pointer type named LockMethod.
      
      . Remove elog(FATAL) after InitLockTable() call in
        CreateSharedMemoryAndSemaphores(), because if something goes wrong,
        there is elog(FATAL) in LockMethodTableInit(), and if this doesn't
        help, an elog(ERROR) in InitLockTable() is promoted to FATAL.
      
      . Make InitLockTable() void, because its only caller does not use its
        return value any more.
      
      . Rename variables in lock.c to avoid statements like
              LockMethodTable[NumLockMethods] = lockMethodTable;
              lockMethodTable = LockMethodTable[lockmethod];
      
      . Change LOCKMETHODID type to uint16 to fit into struct LOCKTAG.
      
      . Remove static variables BITS_OFF and BITS_ON from lock.c, because
        I agree to this doubt:
       * XXX is a fetch from a static array really faster than a shift?
      
      . Define and use macros LOCKBIT_ON/OFF.
      
      
      Manfred Koizar
      e7ca8674
  13. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  14. 04 Sep, 2003 1 commit
    • Tom Lane's avatar
      Reimplement hash index locking algorithms, per my recent proposal to · 7a369371
      Tom Lane authored
      pghackers.  This fixes the problem recently reported by Markus KrÌutner
      (hash bucket split corrupts the state of scans being done concurrently),
      and I believe it also fixes all the known problems with deadlocks in
      hash index operations.  Hash indexes are still not really ready for prime
      time (since they aren't WAL-logged), but this is a step forward.
      7a369371
  15. 17 Aug, 2003 1 commit
  16. 04 Aug, 2003 1 commit
  17. 24 Jul, 2003 1 commit
  18. 19 Feb, 2003 2 commits
    • Bruce Momjian's avatar
    • Bruce Momjian's avatar
      - Modifies LOCKTAG to include a 'classId'. Relation receive a classId of · d0f3a7e9
      Bruce Momjian authored
      RelOid_pg_class, and transaction locks XactLockTableId. RelId is renamed
      to objId.
      
      - LockObject() and UnlockObject() functions created, and their use
      sprinkled throughout the code to do descent locking for domains and
      types. They accept lock modes AccessShare and AccessExclusive, as we
      only really need a 'read' and 'write' lock at the moment.  Most locking
      cases are held until the end of the transaction.
      
      This fixes the cases Tom mentioned earlier in regards to locking with
      Domains.  If the patch is good, I'll work on cleaning up issues with
      other database objects that have this problem (most of them).
      
      Rod Taylor
      d0f3a7e9
  19. 01 Aug, 2002 1 commit
  20. 20 Jun, 2002 1 commit
  21. 25 Oct, 2001 1 commit
  22. 27 Sep, 2001 1 commit
  23. 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
  24. 09 Jul, 2001 1 commit
  25. 22 Jun, 2001 1 commit
  26. 19 Jun, 2001 1 commit
    • Tom Lane's avatar
      Clean up some longstanding problems in shared-cache invalidation. · bbbc00af
      Tom Lane authored
      SI messages now include the relevant database OID, so that operations
      in one database do not cause useless cache flushes in backends attached
      to other databases.  Declare SI messages properly using a union, to
      eliminate the former assumption that Oid is the same size as int or Index.
      Rewrite the nearly-unreadable code in inval.c, and document it better.
      Arrange for catcache flushes at end of command/transaction to happen before
      relcache flushes do --- this avoids loading a new tuple into the catcache
      while setting up new relcache entry, only to have it be flushed again
      immediately.
      bbbc00af
  27. 12 Jun, 2001 1 commit
    • Tom Lane's avatar
      Clean up various to-do items associated with system indexes: · 1d584f97
      Tom Lane authored
      pg_database now has unique indexes on oid and on datname.
      pg_shadow now has unique indexes on usename and on usesysid.
      pg_am now has unique index on oid.
      pg_opclass now has unique index on oid.
      pg_amproc now has unique index on amid+amopclaid+amprocnum.
      Remove pg_rewrite's unnecessary index on oid, delete unused RULEOID syscache.
      Remove index on pg_listener and associated syscache for performance reasons
      (caching rows that are certain to change before you need 'em again is
      rather pointless).
      Change pg_attrdef's nonunique index on adrelid into a unique index on
      adrelid+adnum.
      
      Fix various incorrect settings of pg_class.relisshared, make that the
      primary reference point for whether a relation is shared or not.
      IsSharedSystemRelationName() is now only consulted to initialize relisshared
      during initial creation of tables and indexes.  In theory we might now
      support shared user relations, though it's not clear how one would get
      entries for them into pg_class &etc of multiple databases.
      
      Fix recently reported bug that pg_attribute rows created for an index all have
      the same OID.  (Proof that non-unique OID doesn't matter unless it's
      actually used to do lookups ;-))
      
      There's no need to treat pg_trigger, pg_attrdef, pg_relcheck as bootstrap
      relations.  Convert them into plain system catalogs without hardwired
      entries in pg_class and friends.
      
      Unify global.bki and template1.bki into a single init script postgres.bki,
      since the alleged distinction between them was misleading and pointless.
      Not to mention that it didn't work for setting up indexes on shared
      system relations.
      
      Rationalize locking of pg_shadow, pg_group, pg_attrdef (no need to use
      AccessExclusiveLock where ExclusiveLock or even RowExclusiveLock will do).
      Also, hold locks until transaction commit where necessary.
      1d584f97
  28. 22 Mar, 2001 1 commit
  29. 24 Jan, 2001 1 commit
  30. 22 Dec, 2000 1 commit
    • Tom Lane's avatar
      Revise lock manager to support "session level" locks as well as "transaction · 6cc842ab
      Tom Lane authored
      level" locks.  A session lock is not released at transaction commit (but it
      is released on transaction abort, to ensure recovery after an elog(ERROR)).
      In VACUUM, use a session lock to protect the master table while vacuuming a
      TOAST table, so that the TOAST table can be done in an independent
      transaction.
      
      I also took this opportunity to do some cleanup and renaming in the lock
      code.  The previously noted bug in ProcLockWakeup, that it couldn't wake up
      any waiters beyond the first non-wakeable waiter, is now fixed.  Also found
      a previously unknown bug of the same kind (failure to scan all members of
      a lock queue in some cases) in DeadLockCheck.  This might have led to failure
      to detect a deadlock condition, resulting in indefinite waits, but it's
      difficult to characterize the conditions required to trigger a failure.
      6cc842ab
  31. 30 Nov, 2000 1 commit
    • Tom Lane's avatar
      Rearrange bufmgr header files so that buf_internals.h need not be · 680b7357
      Tom Lane authored
      included by everything that includes bufmgr.h --- it's supposed to be
      internals, after all, not part of the API!  This fixes the conflict
      against FreeBSD headers reported by Rosenman, by making it unnecessary
      for s_lock.h to be included by plperl.c.
      680b7357
  32. 08 Jun, 2000 1 commit
  33. 31 May, 2000 1 commit
    • Peter Eisentraut's avatar
      The heralded `Grand Unified Configuration scheme' (GUC) · 6a68f426
      Peter Eisentraut authored
      That means you can now set your options in either or all of $PGDATA/configuration,
      some postmaster option (--enable-fsync=off), or set a SET command. The list of
      options is in backend/utils/misc/guc.c, documentation will be written post haste.
      
      pg_options is gone, so is that pq_geqo config file. Also removed were backend -K,
      -Q, and -T options (no longer applicable, although -d0 does the same as -Q).
      
      Added to configure an --enable-syslog option.
      
      changed all callers from TPRINTF to elog(DEBUG)
      6a68f426
  34. 12 Apr, 2000 1 commit
  35. 26 Jan, 2000 1 commit
    • Bruce Momjian's avatar
      Add: · 5c25d602
      Bruce Momjian authored
        * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
      
      to all files copyright Regents of Berkeley.  Man, that's a lot of files.
      5c25d602
  36. 28 Nov, 1999 1 commit
  37. 17 Nov, 1999 1 commit
  38. 18 Sep, 1999 1 commit
    • Tom Lane's avatar
      Mega-commit to make heap_open/heap_openr/heap_close take an · bd272cac
      Tom Lane authored
      additional argument specifying the kind of lock to acquire/release (or
      'NoLock' to do no lock processing).  Ensure that all relations are locked
      with some appropriate lock level before being examined --- this ensures
      that relevant shared-inval messages have been processed and should prevent
      problems caused by concurrent VACUUM.  Fix several bugs having to do with
      mismatched increment/decrement of relation ref count and mismatched
      heap_open/close (which amounts to the same thing).  A bogus ref count on
      a relation doesn't matter much *unless* a SI Inval message happens to
      arrive at the wrong time, which is probably why we got away with this
      sloppiness for so long.  Repair missing grab of AccessExclusiveLock in
      DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi.
      Recommend 'make clean all' after pulling this update; I modified the
      Relation struct layout slightly.
      Will post further discussion to pghackers list shortly.
      bd272cac