1. 10 May, 2005 1 commit
  2. 06 May, 2005 1 commit
  3. 14 Apr, 2005 2 commits
    • Tom Lane's avatar
      Completion of project to use fixed OIDs for all system catalogs and · 162bd08b
      Tom Lane authored
      indexes.  Replace all heap_openr and index_openr calls by heap_open
      and index_open.  Remove runtime lookups of catalog OID numbers in
      various places.  Remove relcache's support for looking up system
      catalogs by name.  Bulky but mostly very boring patch ...
      162bd08b
    • Tom Lane's avatar
      First phase of project to use fixed OIDs for all system catalogs and · 7c13781e
      Tom Lane authored
      indexes.  Extend the macros in include/catalog/*.h to carry the info
      about hand-assigned OIDs, and adjust the genbki script and bootstrap
      code to make the relations actually get those OIDs.  Remove the small
      number of RelOid_pg_foo macros that we had in favor of a complete
      set named like the catname.h and indexing.h macros.  Next phase will
      get rid of internal use of names for looking up catalogs and indexes;
      but this completes the changes forcing an initdb, so it looks like a
      good place to commit.
      Along the way, I made the shared relations (pg_database etc) not be
      'bootstrap' relations any more, so as to reduce the number of hardwired
      entries and simplify changing those relations in future.  I'm not
      sure whether they ever really needed to be handled as bootstrap
      relations, but it seems to work fine to not do so now.
      7c13781e
  4. 13 Apr, 2005 1 commit
    • Tom Lane's avatar
      Change addRangeTableEntryForRelation() to take a Relation pointer instead · 2fdf9e0b
      Tom Lane authored
      of just a relation OID, thereby not having to open the relation for itself.
      This actually saves code rather than adding it for most of the existing
      callers, which had the rel open already.  The main point though is to be
      able to use this rather than plain addRangeTableEntry in setTargetTable,
      thus saving one relation_openrv/relation_close cycle for every INSERT,
      UPDATE, or DELETE.  Seems to provide a several percent win on simple
      INSERTs.
      2fdf9e0b
  5. 29 Mar, 2005 1 commit
    • Tom Lane's avatar
      Convert oidvector and int2vector into variable-length arrays. This · 70c9763d
      Tom Lane authored
      change saves a great deal of space in pg_proc and its primary index,
      and it eliminates the former requirement that INDEX_MAX_KEYS and
      FUNC_MAX_ARGS have the same value.  INDEX_MAX_KEYS is still embedded
      in the on-disk representation (because it affects index tuple header
      size), but FUNC_MAX_ARGS is not.  I believe it would now be possible
      to increase FUNC_MAX_ARGS at little cost, but haven't experimented yet.
      There are still a lot of vestigial references to FUNC_MAX_ARGS, which
      I will clean up in a separate pass.  However, getting rid of it
      altogether would require changing the FunctionCallInfoData struct,
      and I'm not sure I want to buy into that.
      70c9763d
  6. 25 Mar, 2005 1 commit
  7. 24 Mar, 2005 1 commit
  8. 23 Mar, 2005 1 commit
  9. 20 Mar, 2005 1 commit
    • Tom Lane's avatar
      Remove unnecessary calls of FlushRelationBuffers: there is no need · 354049c7
      Tom Lane authored
      to write out data that we are about to tell the filesystem to drop.
      smgr_internal_unlink already had a DropRelFileNodeBuffers call to
      get rid of dead buffers without a write after it's no longer possible
      to roll back the deleting transaction.  Adding a similar call in
      smgrtruncate simplifies callers and makes the overall division of
      labor clearer.  This patch removes the former behavior that VACUUM
      would write all dirty buffers of a relation unconditionally.
      354049c7
  10. 16 Mar, 2005 1 commit
    • Tom Lane's avatar
      Revise TupleTableSlot code to avoid unnecessary construction and disassembly · f97aebd1
      Tom Lane authored
      of tuples when passing data up through multiple plan nodes.  A slot can now
      hold either a normal "physical" HeapTuple, or a "virtual" tuple consisting
      of Datum/isnull arrays.  Upper plan levels can usually just copy the Datum
      arrays, avoiding heap_formtuple() and possible subsequent nocachegetattr()
      calls to extract the data again.  This work extends Atsushi Ogawa's earlier
      patch, which provided the key idea of adding Datum arrays to TupleTableSlots.
      (I believe however that something like this was foreseen way back in Berkeley
      days --- see the old comment on ExecProject.)  A test case involving many
      levels of join of fairly wide tables (about 80 columns altogether) showed
      about 3x overall speedup, though simple queries will probably not be
      helped very much.
      
      I have also duplicated some code in heaptuple.c in order to provide versions
      of heap_formtuple and friends that use "bool" arrays to indicate null
      attributes, instead of the old convention of "char" arrays containing either
      'n' or ' '.  This provides a better match to the convention used by
      ExecEvalExpr.  While I have not made a concerted effort to get rid of uses
      of the old routines, I think they should be deprecated and eventually removed.
      f97aebd1
  11. 09 Feb, 2005 1 commit
    • Neil Conway's avatar
      ALTER TABLE ADD COLUMN exhibits a significant memory leak when adding a · 3df9abd1
      Neil Conway authored
      column with a default expression. In that situation, we need to rewrite
      the heap relation. To evaluate the new default expression, we use
      ExecEvalExpr(); however, this can allocate memory in the current memory
      context, and ATRewriteTable() does not switch out of the active portal's
      heap memory context. The end result is a rather large memory leak (on
      the order of gigabytes for a reasonably sized table).
      
      This patch changes ATRewriteTable() to switch to the per-tuple memory
      context before beginning the per-tuple loop. It also removes an explicit
      heap_freetuple() in the loop, since that is no longer needed.
      
      In an unrelated change, I noticed the code was scanning through the
      attributes of the new tuple descriptor for each tuple of the old table.
      I changed this to use precomputation, which should slightly speed up
      the loop.
      
      Thanks to steve@deefs.net for reporting the leak.
      3df9abd1
  12. 27 Jan, 2005 2 commits
  13. 24 Jan, 2005 1 commit
  14. 10 Jan, 2005 1 commit
  15. 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
  16. 16 Nov, 2004 1 commit
    • Neil Conway's avatar
      Prevent a backend crash when processing CREATE TABLE commands with · e1bf6527
      Neil Conway authored
      more than 65K columns, or when the created table has more than 65K columns
      due to adding inherited columns from parent relations. Fix a similar
      crash when processing SELECT queries with more than 65K target list
      entries. In all three cases we would eventually detect the error and
      elog, but the check was being made too late.
      e1bf6527
  17. 05 Nov, 2004 1 commit
    • Tom Lane's avatar
      Create 'default_tablespace' GUC variable that supplies a TABLESPACE · 98e8b480
      Tom Lane authored
      clause implicitly whenever one is not given explicitly.  Remove concept
      of a schema having an associated tablespace, and simplify the rules for
      selecting a default tablespace for a table or index.  It's now just
      (a) explicit TABLESPACE clause; (b) default_tablespace if that's not an
      empty string; (c) database's default.  This will allow pg_dump to use
      SET commands instead of tablespace clauses to determine object locations
      (but I didn't actually make it do so).  All per recent discussions.
      98e8b480
  18. 30 Oct, 2004 1 commit
    • Tom Lane's avatar
      I found a corner case in which it is possible for RI_FKey_check's call · 80559fa9
      Tom Lane authored
      of HeapTupleSatisfiesItself() to trigger a hint-bit update on the tuple:
      if the row was updated or deleted by a subtransaction of my own transaction
      that was later rolled back.  This cannot occur in pre-8.0 of course, so
      the hint-bit patch applied a couple weeks ago is OK for existing releases.
      But for 8.0 it seems we had better fix things so that RI_FKey_check can
      pass the correct buffer number to HeapTupleSatisfiesItself.  Accordingly,
      add fields to the TriggerData struct to carry the buffer ID(s) for the
      old and new tuple(s).  There are other possible solutions but this one
      seems cleanest; it will allow other AFTER-trigger functions to safely
      do tqual.c calls if they want to.  Put new fields at end of struct so
      that there is no API breakage.
      80559fa9
  19. 22 Oct, 2004 1 commit
  20. 21 Oct, 2004 1 commit
    • Tom Lane's avatar
      Disallow referential integrity actions from being deferred; only the · 12a47c6a
      Tom Lane authored
      NO ACTION check is deferrable.  This seems to be a closer approximation
      to what the SQL spec says than what we were doing before, and it prevents
      some anomalous behaviors that are possible now that triggers can fire
      during the execution of PL functions.
      Stephan Szabo.
      12a47c6a
  21. 16 Oct, 2004 1 commit
  22. 12 Oct, 2004 1 commit
  23. 23 Sep, 2004 1 commit
  24. 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
  25. 31 Aug, 2004 2 commits
  26. 29 Aug, 2004 2 commits
  27. 28 Aug, 2004 1 commit
    • Tom Lane's avatar
      Rearrange order of operations in heap_drop_with_catalog and index_drop · 448eb083
      Tom Lane authored
      so that we close and flush the doomed relation's relcache entry before
      we start to delete the underlying catalog rows, rather than afterwards.
      For awhile yesterday I thought that an unexpected relcache entry rebuild
      partway through this sequence might explain the infrequent parallel
      regression failures we were chasing.  It doesn't, mainly because there's
      no CommandCounterIncrement in the sequence and so the deletions aren't
      "really" done yet.  But it sure seems like trouble waiting to happen.
      448eb083
  28. 15 Aug, 2004 1 commit
    • Tom Lane's avatar
      Dept. of further reflection: I looked around to see if any other callers · 1a3de15a
      Tom Lane authored
      of XLogInsert had the same sort of checkpoint interlock problem as
      RecordTransactionCommit, and indeed I found some.  Btree index build
      and ALTER TABLE SET TABLESPACE write data outside the friendly confines
      of the buffer manager, and therefore they have to take their own
      responsibility for checkpoint interlock.  The easiest solution seems to
      be to force smgrimmedsync at the end of the index build or table copy,
      even when the operation is being WAL-logged.  This is sufficient since
      the new index or table will be of interest to no one if we don't get
      as far as committing the current transaction.
      1a3de15a
  29. 13 Aug, 2004 1 commit
  30. 04 Aug, 2004 1 commit
  31. 01 Aug, 2004 1 commit
  32. 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
  33. 19 Jul, 2004 1 commit
  34. 17 Jul, 2004 1 commit
  35. 11 Jul, 2004 1 commit
  36. 01 Jul, 2004 1 commit