1. 12 3月, 2003 1 次提交
  2. 10 3月, 2003 1 次提交
    • T
      Restructure parsetree representation of DECLARE CURSOR: now it's a · aa83bc04
      Tom Lane 提交于
      utility statement (DeclareCursorStmt) with a SELECT query dangling from
      it, rather than a SELECT query with a few unusual fields in it.  Add
      code to determine whether a planned query can safely be run backwards.
      If DECLARE CURSOR specifies SCROLL, ensure that the plan can be run
      backwards by adding a Materialize plan node if it can't.  Without SCROLL,
      you get an error if you try to fetch backwards from a cursor that can't
      handle it.  (There is still some discussion about what the exact
      behavior should be, but this is necessary infrastructure in any case.)
      Along the way, make EXPLAIN DECLARE CURSOR work.
      aa83bc04
  3. 03 2月, 2003 1 次提交
    • T
      Tweak planner and executor to avoid doing ExecProject() in table scan · 4cff59d8
      Tom Lane 提交于
      nodes where it's not really necessary.  In many cases where the scan node
      is not the topmost plan node (eg, joins, aggregation), it's possible to
      just return the table tuple directly instead of generating an intermediate
      projection tuple.  In preliminary testing, this reduced the CPU time
      needed for 'SELECT COUNT(*) FROM foo' by about 10%.
      4cff59d8
  4. 23 1月, 2003 1 次提交
  5. 13 1月, 2003 1 次提交
  6. 11 1月, 2003 1 次提交
  7. 09 1月, 2003 1 次提交
  8. 18 12月, 2002 1 次提交
  9. 16 12月, 2002 2 次提交
    • T
      Tweak default memory context allocation policy so that a context is not · e64c7feb
      Tom Lane 提交于
      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
    • T
      Revise executor APIs so that all per-query state structure is built in · 5bab36e9
      Tom Lane 提交于
      a per-query memory context created by CreateExecutorState --- and destroyed
      by FreeExecutorState.  This provides a final solution to the longstanding
      problem of memory leaked by various ExecEndNode calls.
      5bab36e9
  10. 14 12月, 2002 1 次提交
  11. 12 12月, 2002 1 次提交
    • T
      Phase 2 of read-only-plans project: restructure expression-tree nodes · a0bf885f
      Tom Lane 提交于
      so that all executable expression nodes inherit from a common supertype
      Expr.  This is somewhat of an exercise in code purity rather than any
      real functional advance, but getting rid of the extra Oper or Func node
      formerly used in each operator or function call should provide at least
      a little space and speed improvement.
      initdb forced by changes in stored-rules representation.
      a0bf885f
  12. 05 12月, 2002 2 次提交
  13. 30 11月, 2002 1 次提交
  14. 23 11月, 2002 1 次提交
    • B
      This patch implements FOR EACH STATEMENT triggers, per my email to · 1b7f3cc0
      Bruce Momjian 提交于
      -hackers a couple days ago.
      
      Notes/caveats:
      
              - added regression tests for the new functionality, all
                regression tests pass on my machine
      
              - added pg_dump support
      
              - updated PL/PgSQL to support per-statement triggers; didn't
                look at the other procedural languages.
      
              - there's (even) more code duplication in trigger.c than there
                was previously. Any suggestions on how to refactor the
                ExecXXXTriggers() functions to reuse more code would be
                welcome -- I took a brief look at it, but couldn't see an
                easy way to do it (there are several subtly-different
                versions of the code in question)
      
              - updated the documentation. I also took the liberty of
                removing a big chunk of duplicated syntax documentation in
                the Programmer's Guide on triggers, and moving that
                information to the CREATE TRIGGER reference page.
      
              - I also included some spelling fixes and similar small
                cleanups I noticed while making the changes. If you'd like
                me to split those into a separate patch, let me know.
      
      Neil Conway
      1b7f3cc0
  15. 13 11月, 2002 2 次提交
  16. 12 11月, 2002 1 次提交
    • T
      Code review for ON COMMIT patch. Make the actual on-commit action happen · f9b5b41e
      Tom Lane 提交于
      before commit, not after :-( --- the original coding is not only unsafe
      if an error occurs while it's processing, but it generates an invalid
      sequence of WAL entries.  Resurrect 7.2 logic for deleting items when
      no longer needed.  Use an enum instead of random macros.  Editorialize
      on names used for routines and constants.  Teach backend/nodes routines
      about new field in CreateTable struct.  Add a regression test.
      f9b5b41e
  17. 11 11月, 2002 1 次提交
  18. 10 11月, 2002 2 次提交
  19. 15 10月, 2002 1 次提交
    • T
      Arrange to copy relcache's trigdesc structure at the start of any · 8f2a289d
      Tom Lane 提交于
      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
  20. 24 9月, 2002 1 次提交
    • T
      Further thinking about heap_mark4update: in HeapTupleSelfUpdated case, · 233ecca7
      Tom Lane 提交于
      executor should not return the tuple as successfully marked, because in
      fact it's been deleted.  Not clear that this case has ever been seen
      in practice (I think you'd have to write a SELECT FOR UPDATE that calls
      a function that deletes some row the SELECT will visit later...) but we
      should be consistent.  Also add comments to several other places that
      got it right but didn't explain what they were doing.
      233ecca7
  21. 05 9月, 2002 1 次提交
  22. 02 9月, 2002 1 次提交
    • T
      Code review for HeapTupleHeader changes. Add version number to page headers · c7a165ad
      Tom Lane 提交于
      (overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask,
      per earlier discussion.  Simplify scheme for overlaying fields in tuple
      header (no need for cmax to live in more than one place).  Don't try to
      clear infomask status bits in tqual.c --- not safe to do it there.  Don't
      try to force output table of a SELECT INTO to have OIDs, either.  Get rid
      of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which
      has already caused one recent failure.  Improve documentation.
      c7a165ad
  23. 29 8月, 2002 2 次提交
  24. 16 8月, 2002 1 次提交
    • B
      Tom Lane wrote: · b1a5f872
      Bruce Momjian 提交于
      > There's no longer a separate call to heap_storage_create in that routine
      > --- the right place to make the test is now in the storage_create
      > boolean parameter being passed to heap_create.  A simple change, but
      > it passeth patch's understanding ...
      
      Thanks.
      
      Attached is a patch against cvs tip as of 8:30 PM PST or so. Turned out
      that even after fixing the failed hunks, there was a new spot in
      bufmgr.c which needed to be fixed (related to temp relations;
      RelationUpdateNumberOfBlocks). But thankfully the regression test code
      caught it :-)
      
      Joe Conway
      b1a5f872
  25. 08 8月, 2002 1 次提交
  26. 04 8月, 2002 1 次提交
    • B
      Change messages like this: · 7312c19a
      Bruce Momjian 提交于
      ERROR:  ExecInsert: rejected due to CHECK constraint insert_con
      
      To be like this:
      
      ERROR:  ExecInsert: rejected due to CHECK constraint "insert_con" on
      "insert_tbl"
      
      Updated regression tests to match.
      
      I got sick of seeing 'rejected due to CHECK constraint "$1" in my log and
      not being able to find the bug in our website code...
      
      Christopher Kings-Lynne
      7312c19a
  27. 20 7月, 2002 1 次提交
    • B
      oid is needed, it is added at the end of the struct (after the null · b0f5086e
      Bruce Momjian 提交于
      bitmap, if present).
      
      Per Tom Lane's suggestion the information whether a tuple has an oid
      or not is carried in the tuple descriptor.  For debugging reasons
      tdhasoid is of type char, not bool.  There are predefined values for
      WITHOID, WITHOUTOID and UNDEFOID.
      
      This patch has been generated against a cvs snapshot from last week
      and I don't expect it to apply cleanly to current sources.  While I
      post it here for public review, I'm working on a new version against a
      current snapshot.  (There's been heavy activity recently; hope to
      catch up some day ...)
      
      This is a long patch;  if it is too hard to swallow, I can provide it
      in smaller pieces:
      
      Part 1:  Accessor macros
      Part 2:  tdhasoid in TupDesc
      Part 3:  Regression test
      Part 4:  Parameter withoid to heap_addheader
      Part 5:  Eliminate t_oid from HeapTupleHeader
      
      Part 2 is the most hairy part because of changes in the executor and
      even in the parser;  the other parts are straightforward.
      
      Up to part 4 the patched postmaster stays binary compatible to
      databases created with an unpatched version.  Part 5 is small (100
      lines) and finally breaks compatibility.
      
      Manfred Koizar
      b0f5086e
  28. 12 7月, 2002 1 次提交
  29. 27 6月, 2002 2 次提交
  30. 26 6月, 2002 2 次提交
    • B
      Back out cleanup patch. Got old version and needs work. · e2c00704
      Bruce Momjian 提交于
      Neil Conway
      e2c00704
    • B
      The attached patch fixes some spelling mistakes, makes the · ed275aea
      Bruce Momjian 提交于
      comments on one of the optimizer functions a lot more
      clear, adds a summary of the recent KSQO discussion to the
      comments in the code, adds regression tests for the bug with
      sequence state Tom fixed recently and another reg. test, and
      removes some PostQuel legacy stuff: ExecAppend -> ExecInsert,
      ExecRetrieve -> ExecSelect, etc. This was changed because the
      elog() messages from this routine are user-visible, so we
      should be using the SQL terms.
      
      Neil Conway
      ed275aea
  31. 21 6月, 2002 1 次提交
  32. 25 5月, 2002 1 次提交
    • T
      Mark index entries "killed" when they are no longer visible to any · 3f4d4880
      Tom Lane 提交于
      transaction, so as to avoid returning them out of the index AM.  Saves
      repeated heap_fetch operations on frequently-updated rows.  Also detect
      queries on unique keys (equality to all columns of a unique index), and
      don't bother continuing scan once we have found first match.
      
      Killing is implemented in the btree and hash AMs, but not yet in rtree
      or gist, because there isn't an equally convenient place to do it in
      those AMs (the outer amgetnext routine can't do it without re-pinning
      the index page).
      
      Did some small cleanup on APIs of HeapTupleSatisfies, heap_fetch, and
      index_insert to make this a little easier.
      3f4d4880
  33. 22 5月, 2002 1 次提交