1. 03 5月, 2003 1 次提交
    • T
      Portal and memory management infrastructure for extended query protocol. · de28dc9a
      Tom Lane 提交于
      Both plannable queries and utility commands are now always executed
      within Portals, which have been revamped so that they can handle the
      load (they used to be good only for single SELECT queries).  Restructure
      code to push command-completion-tag selection logic out of postgres.c,
      so that it won't have to be duplicated between simple and extended queries.
      initdb forced due to addition of a field to Query nodes.
      de28dc9a
  2. 28 3月, 2003 1 次提交
    • B
      This patch implements holdable cursors, following the proposal · 54f7338f
      Bruce Momjian 提交于
      (materialization into a tuple store) discussed on pgsql-hackers earlier.
      I've updated the documentation and the regression tests.
      
      Notes on the implementation:
      
      - I needed to change the tuple store API slightly -- it assumes that it
      won't be used to hold data across transaction boundaries, so the temp
      files that it uses for on-disk storage are automatically reclaimed at
      end-of-transaction. I added a flag to tuplestore_begin_heap() to control
      this behavior. Is changing the tuple store API in this fashion OK?
      
      - in order to store executor results in a tuple store, I added a new
      CommandDest. This works well for the most part, with one exception: the
      current DestFunction API doesn't provide enough information to allow the
      Executor to store results into an arbitrary tuple store (where the
      particular tuple store to use is chosen by the call site of
      ExecutorRun). To workaround this, I've temporarily hacked up a solution
      that works, but is not ideal: since the receiveTuple DestFunction is
      passed the portal name, we can use that to lookup the Portal data
      structure for the cursor and then use that to get at the tuple store the
      Portal is using. This unnecessarily ties the Portal code with the
      tupleReceiver code, but it works...
      
      The proper fix for this is probably to change the DestFunction API --
      Tom suggested passing the full QueryDesc to the receiveTuple function.
      In that case, callers of ExecutorRun could "subclass" QueryDesc to add
      any additional fields that their particular CommandDest needed to get
      access to. This approach would work, but I'd like to think about it for
      a little bit longer before deciding which route to go. In the mean time,
      the code works fine, so I don't think a fix is urgent.
      
      - (semi-related) I added a NO SCROLL keyword to DECLARE CURSOR, and
      adjusted the behavior of SCROLL in accordance with the discussion on
      -hackers.
      
      - (unrelated) Cleaned up some SGML markup in sql.sgml, copy.sgml
      
      Neil Conway
      54f7338f
  3. 17 12月, 2002 1 次提交
    • T
      Code review for palloc0 patch --- avoid dangerous and unnecessary · 88177f77
      Tom Lane 提交于
      practice of evaluating MemSet's arguments multiple times, except for
      the special case of newNode(), where we can assume the argument is
      a constant sizeof() operator.
      Also, add GetMemoryChunkContext() to mcxt.c's API, in preparation for
      fixing recent GEQO breakage.
      88177f77
  4. 16 12月, 2002 1 次提交
    • 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
  5. 13 11月, 2002 1 次提交
  6. 10 11月, 2002 1 次提交
  7. 11 10月, 2002 2 次提交
  8. 12 8月, 2002 1 次提交
    • T
      Change memory-space accounting mechanism in tuplesort.c and tuplestore.c · 77a7e996
      Tom Lane 提交于
      to make a reasonable attempt at accounting for palloc overhead, not just
      the requested size of each memory chunk.  Since in many scenarios this
      will make for a significant reduction in the amount of space acquired,
      partially compensate by doubling the default value of SORT_MEM to 1Mb.
      Per discussion in pgsql-general around 9-Jun-2002..
      77a7e996
  9. 11 8月, 2002 1 次提交
    • B
      This patch removes a lot of unused code related to assertions and · c5354dff
      Bruce Momjian 提交于
      error handling, and simplifies the code that remains. Apparently,
      the code that left Berkeley had a whole "error handling subsystem",
      which exceptions and whatnot. Since we don't use that anymore,
      there's no reason to keep it around.
      
      The regression tests pass with the patch applied. Unless anyone
      sees a problem, please apply.
      
      Neil Conway
      c5354dff
  10. 21 6月, 2002 1 次提交
  11. 25 10月, 2001 1 次提交
  12. 22 3月, 2001 1 次提交
  13. 06 2月, 2001 1 次提交
    • T
      Out-of-bounds memory allocation request sizes should be treated as just · 85c17dbf
      Tom Lane 提交于
      elog(ERROR) not an Assert trap, since we've downgraded out-of-memory to
      elog(ERROR) not a fatal error.  Also, change the hard boundary from 256Mb
      to 1Gb, just so that anyone who's actually got that much memory to spare
      can play with TOAST objects approaching a gigabyte.
      85c17dbf
  14. 25 1月, 2001 1 次提交
  15. 12 1月, 2001 1 次提交
  16. 22 8月, 2000 1 次提交
  17. 11 7月, 2000 1 次提交
    • B
      Here is the patch with memory leak checker. This checker allow detect · 46fb9c29
      Bruce Momjian 提交于
      in-chunk leaks, overwrite-next-chunk leaks and overwrite block-freeptr leaks.
      
      A in-chunk leak --- if something overwrite space after wanted (via palloc()
      size, but it is still inside chunk. For example
      
              x = palloc(12);         /* create 16b chunk */
              memset(x, '#', 13);
      
      this leak is in the current source total invisible, because chunk is 16b and
      leak is in the "align space".
      
       For this feature I add data_size to StandardChunk, and all memory which go
      from AllocSetAlloc() is marked as 0x7F.
      
       The MemoryContextCheck() is compiled '#ifdef USE_ASSERT_CHECKING'.
      
      I add this checking to 'tcop/postgres.c' and is active after each backend
      query, but it is probably not sufficient, because some MemoryContext exist
      only during memory processing --- will good if someone who known where
      it is needful (Tom:-) add it for others contexts;
       A problem in the current source is that we have still some malloc()
      allocation that is not needful and this allocation is total invisible for
      all context routines. For example Dllist in backend (pretty dirty it is in
      catcache where values in Dllist are palloc-ed, but list is malloc-ed).
      --- and BTW. this Dllist design stand in the way for query cache :-)
      
       Tom, if you agree I start replace some mallocs.
      
       BTW. --- Tom, have you idea for across transaction presistent allocation for
                SQL functions? (like regex - now it is via malloc)
      
      
       I almost forget. I add one if() to AllocSetAlloc(), for 'size' that are
      greater than ALLOC_BIGCHUNK_LIMIT is not needful check AllocSetFreeIndex(),
      because 'fidx' is always 'ALLOCSET_NUM_FREELISTS - 1'. It a little brisk up
      allocation for very large chunks. Right?
      
                                                      Karel
      46fb9c29
  18. 28 6月, 2000 1 次提交
    • T
      First phase of memory management rewrite (see backend/utils/mmgr/README · 1aebc361
      Tom Lane 提交于
      for details).  It doesn't really do that much yet, since there are no
      short-term memory contexts in the executor, but the infrastructure is
      in place and long-term contexts are handled reasonably.  A few long-
      standing bugs have been fixed, such as 'VACUUM; anything' in a single
      query string crashing.  Also, out-of-memory is now considered a
      recoverable ERROR, not FATAL.
      Eliminate a large amount of crufty, now-dead code in and around
      memory management.
      Fix problem with holding off SIGTRAP, SIGSEGV, etc in postmaster and
      backend startup.
      1aebc361
  19. 21 5月, 2000 1 次提交
  20. 26 1月, 2000 1 次提交
    • B
      Add: · 5c25d602
      Bruce Momjian 提交于
        * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
      
      to all files copyright Regents of Berkeley.  Man, that's a lot of files.
      5c25d602
  21. 18 7月, 1999 1 次提交
  22. 16 7月, 1999 3 次提交
  23. 15 7月, 1999 1 次提交
  24. 26 5月, 1999 1 次提交
  25. 23 3月, 1999 1 次提交
    • B
      Hi, · 48ea8b76
      Bruce Momjian 提交于
      I have solved some problems with dynamic loading on NT. It is possible
      to
      run succesfully both trigger and plpgsql regression tests. The patch is
      in
      the included file "diff".
      
                              Dan
      48ea8b76
  26. 14 2月, 1999 1 次提交
  27. 07 2月, 1999 1 次提交
  28. 01 9月, 1998 2 次提交
  29. 16 6月, 1998 1 次提交
  30. 26 2月, 1998 1 次提交
  31. 09 9月, 1997 1 次提交
  32. 08 9月, 1997 1 次提交
  33. 07 9月, 1997 1 次提交
  34. 20 8月, 1997 1 次提交
  35. 08 11月, 1996 1 次提交
  36. 09 7月, 1996 1 次提交