1. 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
  2. 20 Feb, 2005 1 commit
    • 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
  3. 15 Feb, 2005 1 commit
  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. 23 Dec, 2004 1 commit
  6. 02 Dec, 2004 1 commit
    • Tom Lane's avatar
      Disallow the combination VACUUM FULL FREEZE for safety's sake, for the · e9c03c3b
      Tom Lane authored
      reasons I outlined in pghackers a few days ago.
      
      Also, undo someone's overly optimistic decision to reduce tuple state
      checks from if (...) elog() to Asserts.  If I trusted this code more,
      I might think it was a good idea to disable these checks in production
      installations.  But I don't.
      e9c03c3b
  7. 01 Dec, 2004 1 commit
    • Tom Lane's avatar
      Change planner to use the current true disk file size as its estimate of · 5374d097
      Tom Lane authored
      a relation's number of blocks, rather than the possibly-obsolete value
      in pg_class.relpages.  Scale the value in pg_class.reltuples correspondingly
      to arrive at a hopefully more accurate number of rows.  When pg_class
      contains 0/0, estimate a tuple width from the column datatypes and divide
      that into current file size to estimate number of rows.  This improved
      methodology allows us to jettison the ancient hacks that put bogus default
      values into pg_class when a table is first created.  Also, per a suggestion
      from Simon, make VACUUM (but not VACUUM FULL or ANALYZE) adjust the value
      it puts into pg_class.reltuples to try to represent the mean tuple density
      instead of the minimal density that actually prevails just after VACUUM.
      These changes alter the plans selected for certain regression tests, so
      update the expected files accordingly.  (I removed join_1.out because
      it's not clear if it still applies; we can add back any variant versions
      as they are shown to be needed.)
      5374d097
  8. 15 Oct, 2004 1 commit
  9. 07 Oct, 2004 2 commits
  10. 30 Sep, 2004 1 commit
  11. 13 Sep, 2004 1 commit
    • Tom Lane's avatar
      Redesign query-snapshot timing so that volatile functions in READ COMMITTED · b2c40712
      Tom Lane authored
      mode see a fresh snapshot for each command in the function, rather than
      using the latest interactive command's snapshot.  Also, suppress fresh
      snapshots as well as CommandCounterIncrement inside STABLE and IMMUTABLE
      functions, instead using the snapshot taken for the most closely nested
      regular query.  (This behavior is only sane for read-only functions, so
      the patch also enforces that such functions contain only SELECT commands.)
      As per my proposal of 6-Sep-2004; I note that I floated essentially the
      same proposal on 19-Jun-2002, but that discussion tailed off without any
      action.  Since 8.0 seems like the right place to be taking possibly
      nontrivial backwards compatibility hits, let's get it done now.
      b2c40712
  12. 30 Aug, 2004 1 commit
  13. 29 Aug, 2004 2 commits
  14. 23 Aug, 2004 1 commit
    • Tom Lane's avatar
      Rearrange pg_subtrans handling as per recent discussion. pg_subtrans · 4dbb880d
      Tom Lane authored
      updates are no longer WAL-logged nor even fsync'd; we do not need to,
      since after a crash no old pg_subtrans data is needed again.  We truncate
      pg_subtrans to RecentGlobalXmin at each checkpoint.  slru.c's API is
      refactored a little bit to separate out the necessary decisions.
      4dbb880d
  15. 06 Aug, 2004 1 commit
  16. 31 Jul, 2004 1 commit
  17. 21 Jul, 2004 1 commit
    • Tom Lane's avatar
      Invent WAL timelines, as per recent discussion, to make point-in-time · 2042b342
      Tom Lane authored
      recovery more manageable.  Also, undo recent change to add FILE_HEADER
      and WASTED_SPACE records to XLOG; instead make the XLOG page header
      variable-size with extra fields in the first page of an XLOG file.
      This should fix the boundary-case bugs observed by Mark Kirkwood.
      initdb forced due to change of XLOG representation.
      2042b342
  18. 20 Jul, 2004 1 commit
  19. 01 Jul, 2004 1 commit
  20. 08 Jun, 2004 1 commit
    • Bruce Momjian's avatar
      vacuum.c refactoring · 5e926cbb
      Bruce Momjian authored
         . rename variables
           . cur_buffer -> dst_buffer
           . ToPage -> dst_page
           . cur_page -> dst_vacpage
         . move variable declarations into block where variable is used
         . various Asserts instead of elog(ERROR, ...)
         . extract functionality from repair_frag() into new routines
           . move_chain_tuple()
           . move_plain_tuple()
           . update_hint_bits()
         . create type ExecContext
         . add comments
      
      Manfred Koizar
      5e926cbb
  21. 05 Jun, 2004 1 commit
  22. 31 May, 2004 1 commit
    • Tom Lane's avatar
      Minor code rationalization: FlushRelationBuffers just returns void, · e6747079
      Tom Lane authored
      rather than an error code, and does elog(ERROR) not elog(WARNING)
      when it detects a problem.  All callers were simply elog(ERROR)'ing on
      failure return anyway, and I find it hard to envision a caller that would
      not, so we may as well simplify the callers and produce the more useful
      error message directly.
      e6747079
  23. 26 May, 2004 1 commit
    • Neil Conway's avatar
      Reimplement the linked list data structure used throughout the backend. · d0b4399d
      Neil Conway authored
      In the past, we used a 'Lispy' linked list implementation: a "list" was
      merely a pointer to the head node of the list. The problem with that
      design is that it makes lappend() and length() linear time. This patch
      fixes that problem (and others) by maintaining a count of the list
      length and a pointer to the tail node along with each head node pointer.
      A "list" is now a pointer to a structure containing some meta-data
      about the list; the head and tail pointers in that structure refer
      to ListCell structures that maintain the actual linked list of nodes.
      
      The function names of the list API have also been changed to, I hope,
      be more logically consistent. By default, the old function names are
      still available; they will be disabled-by-default once the rest of
      the tree has been updated to use the new API names.
      d0b4399d
  24. 22 May, 2004 1 commit
  25. 21 May, 2004 1 commit
  26. 08 May, 2004 1 commit
    • Tom Lane's avatar
      Get rid of rd_nblocks field in relcache entries. Turns out this was · 4af34211
      Tom Lane authored
      costing us lots more to maintain than it was worth.  On shared tables
      it was of exactly zero benefit because we couldn't trust it to be
      up to date.  On temp tables it sometimes saved an lseek, but not often
      enough to be worth getting excited about.  And the real problem was that
      we forced an lseek on every relcache flush in order to update the field.
      So all in all it seems best to lose the complexity.
      4af34211
  27. 12 Feb, 2004 1 commit
  28. 10 Feb, 2004 2 commits
    • Tom Lane's avatar
      Centralize implementation of delay code by creating a pg_usleep() · 58f337a3
      Tom Lane authored
      subroutine in src/port/pgsleep.c.  Remove platform dependencies from
      miscadmin.h and put them in port.h where they belong.  Extend recent
      vacuum cost-based-delay patch to apply to VACUUM FULL, ANALYZE, and
      non-btree index vacuuming.
      
      By the way, where is the documentation for the cost-based-delay patch?
      58f337a3
    • Tom Lane's avatar
      Restructure smgr API as per recent proposal. smgr no longer depends on · 87bd9563
      Tom Lane authored
      the relcache, and so the notion of 'blind write' is gone.  This should
      improve efficiency in bgwriter and background checkpoint processes.
      Internal restructuring in md.c to remove the not-very-useful array of
      MdfdVec objects --- might as well just use pointers.
      Also remove the long-dead 'persistent main memory' storage manager (mm.c),
      since it seems quite unlikely to ever get resurrected.
      87bd9563
  29. 07 Jan, 2004 1 commit
  30. 06 Jan, 2004 1 commit
    • Neil Conway's avatar
      Code cleanup, mostly in the smgr: · dfc7e7b7
      Neil Conway authored
           - Update comment in IsReservedName() to the present day
      
           - Improve some variable & function names in commands/vacuum.c. I
             was planning to rewrite this to avoid lappend(), but since I
             still intend to do the list rewrite, there's no need for that.
      
           - Update some smgr comments which seemed to imply that we still
             forced all dirty pages to disk at commit-time.
      
           - Replace some #ifdef DIAGNOSTIC code with assertions.
      
           - Make the distinction between OS-level file descriptors and
             virtual file descriptors a little clearer in a few comments
      
           - Other minor comment improvements in the smgr code
      dfc7e7b7
  31. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  32. 13 Nov, 2003 3 commits
  33. 12 Nov, 2003 1 commit
    • Tom Lane's avatar
      Cross-data-type comparisons are now indexable by btrees, pursuant to my · fa5c8a05
      Tom Lane authored
      pghackers proposal of 8-Nov.  All the existing cross-type comparison
      operators (int2/int4/int8 and float4/float8) have appropriate support.
      The original proposal of storing the right-hand-side datatype as part of
      the primary key for pg_amop and pg_amproc got modified a bit in the event;
      it is easier to store zero as the 'default' case and only store a nonzero
      when the operator is actually cross-type.  Along the way, remove the
      long-since-defunct bigbox_ops operator class.
      fa5c8a05
  34. 09 Nov, 2003 1 commit
    • Tom Lane's avatar
      Add operator strategy and comparison-value datatype fields to ScanKey. · c1d62bfd
      Tom Lane authored
      Remove the 'strategy map' code, which was a large amount of mechanism
      that no longer had any use except reverse-mapping from procedure OID to
      strategy number.  Passing the strategy number to the index AM in the
      first place is simpler and faster.
      This is a preliminary step in planned support for cross-datatype index
      operations.  I'm committing it now since the ScanKeyEntryInitialize()
      API change touches quite a lot of files, and I want to commit those
      changes before the tree drifts under me.
      c1d62bfd
  35. 02 Oct, 2003 1 commit