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. 30 4月, 2003 1 次提交
    • T
      Infrastructure for deducing Param types from context, in the same way · aa282d44
      Tom Lane 提交于
      that the types of untyped string-literal constants are deduced (ie,
      when coerce_type is applied to 'em, that's what the type must be).
      Remove the ancient hack of storing the input Param-types array as a
      global variable, and put the info into ParseState instead.  This touches
      a lot of files because of adjustment of routine parameter lists, but
      it's really not a large patch.  Note: PREPARE statement still insists on
      exact specification of parameter types, but that could easily be relaxed
      now, if we wanted to do so.
      aa282d44
  3. 29 4月, 2003 1 次提交
  4. 28 4月, 2003 1 次提交
    • T
      Put back encoding-conversion step in processing of incoming queries; · 982430f8
      Tom Lane 提交于
      I had inadvertently omitted it while rearranging things to support
      length-counted incoming messages.  Also, change the parser's API back
      to accepting a 'char *' query string instead of 'StringInfo', as the
      latter wasn't buying us anything except overhead.  (I think when I put
      it in I had some notion of making the parser API 8-bit-clean, but
      seeing that flex depends on null-terminated input, that's not really
      ever gonna happen.)
      982430f8
  5. 25 4月, 2003 1 次提交
    • T
      Infrastructure for upgraded error reporting mechanism. elog.c is · f690920a
      Tom Lane 提交于
      rewritten and the protocol is changed, but most elog calls are still
      elog calls.  Also, we need to contemplate mechanisms for controlling
      all this functionality --- eg, how much stuff should appear in the
      postmaster log?  And what API should libpq expose for it?
      f690920a
  6. 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
  7. 12 3月, 2003 1 次提交
  8. 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
  9. 15 2月, 2003 1 次提交
  10. 29 1月, 2003 1 次提交
  11. 22 1月, 2003 1 次提交
    • T
      Fix coredump problem in plpgsql's RETURN NEXT. When a SELECT INTO · a4482f4c
      Tom Lane 提交于
      that's selecting into a RECORD variable returns zero rows, make it
      assign an all-nulls row to the RECORD; this is consistent with what
      happens when the SELECT INTO target is not a RECORD.  In support of
      this, tweak the SPI code so that a valid tuple descriptor is returned
      even when a SPI select returns no rows.
      a4482f4c
  12. 31 12月, 2002 1 次提交
  13. 17 12月, 2002 1 次提交
  14. 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
  15. 05 12月, 2002 1 次提交
    • T
      Phase 1 of read-only-plans project: cause executor state nodes to point · 1fd0c59e
      Tom Lane 提交于
      to plan nodes, not vice-versa.  All executor state nodes now inherit from
      struct PlanState.  Copying of plan trees has been simplified by not
      storing a list of SubPlans in Plan nodes (eliminating duplicate links).
      The executor still needs such a list, but it can build it during
      ExecutorStart since it has to scan the plan tree anyway.
      No initdb forced since no stored-on-disk structures changed, but you
      will need a full recompile because of node-numbering changes.
      1fd0c59e
  16. 13 11月, 2002 1 次提交
  17. 11 11月, 2002 1 次提交
  18. 10 11月, 2002 1 次提交
  19. 15 10月, 2002 1 次提交
  20. 05 9月, 2002 1 次提交
  21. 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
  22. 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
  23. 21 6月, 2002 1 次提交
  24. 22 5月, 2002 1 次提交
    • T
      Remove global variable scanCommandId in favor of storing a command ID · 959e61e9
      Tom Lane 提交于
      in snapshots, per my proposal of a few days ago.  Also, tweak heapam.c
      routines (heap_insert, heap_update, heap_delete, heap_mark4update) to
      be passed the command ID to use, instead of doing GetCurrentCommandID.
      For catalog updates they'll still get passed current command ID, but
      for updates generated from the main executor they'll get passed the
      command ID saved in the snapshot the query is using.  This should fix
      some corner cases associated with functions and triggers that advance
      current command ID while an outer query is still in progress.
      959e61e9
  25. 15 4月, 2002 1 次提交
    • T
      The contents of command.c, creatinh.c, define.c, remove.c and rename.c · 71dc300a
      Tom Lane 提交于
      have been divided according to the type of object manipulated - so ALTER
      TABLE code is in tablecmds.c, aggregate commands in aggregatecmds.c and
      so on.
      
      A few common support routines remain in define.c (prototypes in
      src/include/commands/defrem.h).
      
      No code has been changed except for includes to reflect the new files.
      The prototypes for aggregatecmds.c, functioncmds.c, operatorcmds.c,
      and typecmds.c remain in src/include/commands/defrem.h.
      
      From John Gray <jgray@azuli.co.uk>
      71dc300a
  26. 22 3月, 2002 1 次提交
    • T
      First phase of SCHEMA changes, concentrating on fixing the grammar and · 95ef6a34
      Tom Lane 提交于
      the parsetree representation.  As yet we don't *do* anything with schema
      names, just drop 'em on the floor; but you can enter schema-compatible
      command syntax, and there's even a primitive CREATE SCHEMA command.
      No doc updates yet, except to note that you can now extract a field
      from a function-returning-row's result with (foo(...)).fieldname.
      95ef6a34
  27. 28 2月, 2002 1 次提交
    • T
      Clean up BeginCommand and related routines. BeginCommand and EndCommand · 6779c55c
      Tom Lane 提交于
      are now both invoked once per received SQL command (raw parsetree) from
      pg_exec_query_string.  BeginCommand is actually just an empty routine
      at the moment --- all its former operations have been pushed into tuple
      receiver setup routines in printtup.c.  This makes for a clean distinction
      between BeginCommand/EndCommand (once per command) and the tuple receiver
      setup/teardown routines (once per ExecutorRun call), whereas the old code
      was quite ad hoc.  Along the way, clean up the calling conventions for
      ExecutorRun a little bit.
      6779c55c
  28. 27 2月, 2002 1 次提交
    • T
      Restructure command-completion-report code so that there is just one · 56ee2ecb
      Tom Lane 提交于
      report for each received SQL command, regardless of rewriting activity.
      Also ensure that this report comes from the 'original' command, not the
      last command generated by rewrite; this fixes 7.2 breakage for INSERT
      commands that have actions added by rules.  Fernando Nasser and Tom Lane.
      56ee2ecb
  29. 14 2月, 2002 1 次提交
  30. 04 1月, 2002 1 次提交
  31. 22 11月, 2001 1 次提交
  32. 11 11月, 2001 1 次提交
  33. 06 11月, 2001 1 次提交
  34. 25 10月, 2001 1 次提交
  35. 24 10月, 2001 1 次提交
  36. 06 10月, 2001 1 次提交
    • T
      Further cleanup of dynahash.c API, in pursuit of portability and · 8a52b893
      Tom Lane 提交于
      readability.  Bizarre '(long *) TRUE' return convention is gone,
      in favor of just raising an error internally in dynahash.c when
      we detect hashtable corruption.  HashTableWalk is gone, in favor
      of using hash_seq_search directly, since it had no hope of working
      with non-LONGALIGNable datatypes.  Simplify some other code that was
      made undesirably grotty by promixity to HashTableWalk.
      8a52b893
  37. 03 8月, 2001 2 次提交
  38. 02 6月, 2001 1 次提交