1. 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
  2. 29 Aug, 2004 2 commits
  3. 28 Aug, 2004 1 commit
    • Tom Lane's avatar
      Fix relcache to account properly for subtransaction status of 'new' · 1c72d0de
      Tom Lane authored
      relcache entries.  Also, change TransactionIdIsCurrentTransactionId()
      so that if consulted during transaction abort, it will not say that
      the aborted xact is still current.  (It would be better to ensure that
      it's never called at all during abort, but I'm not sure we can easily
      guarantee that.)  In combination, these fix a crash we have seen
      occasionally during parallel regression tests of 8.0.
      1c72d0de
  4. 17 Jul, 2004 1 commit
    • Tom Lane's avatar
      Invent ResourceOwner mechanism as per my recent proposal, and use it to · fe548629
      Tom Lane authored
      keep track of portal-related resources separately from transaction-related
      resources.  This allows cursors to work in a somewhat sane fashion with
      nested transactions.  For now, cursor behavior is non-subtransactional,
      that is a cursor's state does not roll back if you abort a subtransaction
      that fetched from the cursor.  We might want to change that later.
      fe548629
  5. 01 Jul, 2004 1 commit
  6. 18 Jun, 2004 1 commit
  7. 30 May, 2004 1 commit
  8. 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
  9. 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
  10. 01 Apr, 2004 1 commit
    • Tom Lane's avatar
      Replace TupleTableSlot convention for whole-row variables and function · 375369ac
      Tom Lane authored
      results with tuples as ordinary varlena Datums.  This commit does not
      in itself do much for us, except eliminate the horrid memory leak
      associated with evaluation of whole-row variables.  However, it lays the
      groundwork for allowing composite types as table columns, and perhaps
      some other useful features as well.  Per my proposal of a few days ago.
      375369ac
  11. 16 Mar, 2004 1 commit
  12. 14 Mar, 2004 1 commit
  13. 25 Feb, 2004 1 commit
    • Bruce Momjian's avatar
      For application to HEAD, following community review. · c672aa82
      Bruce Momjian authored
      * Changes incorrect CYGWIN defines to __CYGWIN__
      
      * Some localtime returns NULL checks (when unchecked cause SEGVs under
      Win32
      regression tests)
      
      * Rationalized CreateSharedMemoryAndSemaphores and
      AttachSharedMemoryAndSemaphores (Bruce, I finally remembered to do it);
      requires attention.
      
      Claudio Natoli
      c672aa82
  14. 10 Feb, 2004 1 commit
    • 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
  15. 02 Feb, 2004 1 commit
  16. 26 Jan, 2004 1 commit
  17. 28 Dec, 2003 1 commit
    • Tom Lane's avatar
      Clean up the usage of canonicalize_qual(): in particular, be consistent · c607bd69
      Tom Lane authored
      about whether it is applied before or after eval_const_expressions().
      I believe there were some corner cases where the system would fail to
      recognize that a partial index is applicable because of the previous
      inconsistency.  Store normal rather than 'implicit AND' representations
      of constraints and index predicates in the catalogs.
      initdb forced due to representation change of constraints/predicates.
      c607bd69
  18. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  19. 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
  20. 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
  21. 25 Sep, 2003 1 commit
  22. 24 Sep, 2003 1 commit
    • Tom Lane's avatar
      Repair some REINDEX problems per recent discussions. The relcache is · a56a016c
      Tom Lane authored
      now able to cope with assigning new relfilenode values to nailed-in-cache
      indexes, so they can be reindexed using the fully crash-safe method.  This
      leaves only shared system indexes as special cases.  Remove the 'index
      deactivation' code, since it provides no useful protection in the shared-
      index case.  Require reindexing of shared indexes to be done in standalone
      mode, but remove other restrictions on REINDEX.  -P (IgnoreSystemIndexes)
      now prevents using indexes for lookups, but does not disable index updates.
      It is therefore safe to allow from PGOPTIONS.  Upshot: reindexing system catalogs
      can be done without a standalone backend for all cases except
      shared catalogs.
      a56a016c
  23. 04 Aug, 2003 2 commits
  24. 25 Jul, 2003 1 commit
  25. 28 May, 2003 1 commit
    • Tom Lane's avatar
      Replace functional-index facility with expressional indexes. Any column · fc8d970c
      Tom Lane authored
      of an index can now be a computed expression instead of a simple variable.
      Restrictions on expressions are the same as for predicates (only immutable
      functions, no sub-selects).  This fixes problems recently introduced with
      inlining SQL functions, because the inlining transformation is applied to
      both expression trees so the planner can still match them up.  Along the
      way, improve efficiency of handling index predicates (both predicates and
      index expressions are now cached by the relcache) and fix 7.3 oversight
      that didn't record dependencies of predicate expressions.
      fc8d970c
  26. 09 Feb, 2003 1 commit
  27. 16 Dec, 2002 1 commit
    • Tom Lane's avatar
      Fix ALTER TABLE ADD COLUMN to disallow the same column types that are · 260faf0b
      Tom Lane authored
      disallowed by CREATE TABLE (eg, pseudo-types); also disallow these types
      from being introduced by the range-function syntax.  While at it, allow
      CREATE TABLE to create zero-column tables, per recent pghackers discussion.
      I am back-patching this into 7.3 since failure to disallow pseudo-types
      is arguably a security hole.
      260faf0b
  28. 15 Dec, 2002 1 commit
    • Tom Lane's avatar
      Tweak default memory context allocation policy so that a context is not · e64c7feb
      Tom Lane authored
      given any malloc block until something is first allocated in it; but
      thereafter, MemoryContextReset won't release that first malloc block.
      This preserves the quick-reset property of the original policy, without
      forcing 8K to be allocated to every context whether any of it is ever
      used or not.  Also, remove some more no-longer-needed explicit freeing
      during ExecEndPlan.
      e64c7feb
  29. 15 Nov, 2002 1 commit
    • Tom Lane's avatar
      Add relcache support for system catalogs with attnotnull columns. · 24b130cb
      Tom Lane authored
      The code was not making TupleConstr structs for such catalogs in
      several places; with the consequence that the not-null constraint
      wasn't actually enforced.  With this change,
      INSERT INTO pg_proc VALUES('sdf');
      generates a 'Fail to add null value' error instead of a core dump.
      24b130cb
  30. 13 Nov, 2002 1 commit
  31. 11 Nov, 2002 1 commit
  32. 10 Nov, 2002 1 commit
  33. 14 Oct, 2002 1 commit
    • Tom Lane's avatar
      Arrange to copy relcache's trigdesc structure at the start of any · 8f2a289d
      Tom Lane authored
      query that uses it.  This ensures that triggers will be applied consistently
      throughout a query even if someone commits changes to the relation's
      pg_class.reltriggers field meanwhile.  Per crash report from Laurette Cisneros.
      While at it, simplify memory management in relcache.c, which no longer
      needs the old hack to try to keep trigger info in the same place over
      a relcache entry rebuild.  (Should try to fix rd_att and rewrite-rule
      access similarly, someday.)  And make RelationBuildTriggers simpler and
      more robust by making it build the trigdesc in working memory and then
      CopyTriggerDesc() into cache memory.
      8f2a289d
  34. 22 Sep, 2002 1 commit
  35. 04 Sep, 2002 1 commit
  36. 02 Sep, 2002 2 commits
  37. 11 Aug, 2002 1 commit