1. 07 8月, 2003 1 次提交
  2. 04 8月, 2003 2 次提交
  3. 23 7月, 2003 2 次提交
  4. 09 5月, 2003 1 次提交
    • T
      Update 3.0 protocol support to match recent agreements about how to · c0a8c3ac
      Tom Lane 提交于
      handle multiple 'formats' for data I/O.  Restructure CommandDest and
      DestReceiver stuff one more time (it's finally starting to look a bit
      clean though).  Code now matches latest 3.0 protocol document as far
      as message formats go --- but there is no support for binary I/O yet.
      c0a8c3ac
  5. 07 5月, 2003 1 次提交
    • T
      Restructure command destination handling so that we pass around · 79913910
      Tom Lane 提交于
      DestReceiver pointers instead of just CommandDest values.  The DestReceiver
      is made at the point where the destination is selected, rather than
      deep inside the executor.  This cleans up the original kluge implementation
      of tstoreReceiver.c, and makes it easy to support retrieving results
      from utility statements inside portals.  Thus, you can now do fun things
      like Bind and Execute a FETCH or EXPLAIN command, and it'll all work
      as expected (e.g., you can Describe the portal, or use Execute's count
      parameter to suspend the output partway through).  Implementation involves
      stuffing the utility command's output into a Tuplestore, which would be
      kind of annoying for huge output sets, but should be quite acceptable
      for typical uses of utility commands.
      79913910
  6. 06 5月, 2003 1 次提交
    • T
      Implement feature of new FE/BE protocol whereby RowDescription identifies · 2cf57c8f
      Tom Lane 提交于
      the column by table OID and column number, if it's a simple column
      reference.  Along the way, get rid of reskey/reskeyop fields in Resdoms.
      Turns out that representation was not convenient for either the planner
      or the executor; we can make the planner deliver exactly what the
      executor wants with no more effort.
      initdb forced due to change in stored rule representation.
      2cf57c8f
  7. 05 5月, 2003 1 次提交
  8. 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
  9. 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
  10. 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
  11. 19 4月, 2003 1 次提交
  12. 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
  13. 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
  14. 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
  15. 15 11月, 2002 2 次提交
  16. 22 10月, 2002 1 次提交
  17. 15 10月, 2002 1 次提交
  18. 05 9月, 2002 1 次提交
  19. 21 6月, 2002 1 次提交
  20. 21 4月, 2002 1 次提交
    • P
      Scanner performance improvements · 32c6c99e
      Peter Eisentraut 提交于
      Use flex flags -CF.  Pass the to-be-scanned string around as StringInfo
      type, to avoid querying the length repeatedly.  Clean up some code and
      remove lex-compatibility cruft.  Escape backslash sequences inline.  Use
      flex-provided yy_scan_buffer() function to set up input, rather than using
      myinput().
      32c6c99e
  21. 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
  22. 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
  23. 11 11月, 2001 1 次提交
  24. 06 11月, 2001 1 次提交
  25. 28 10月, 2001 1 次提交
  26. 25 10月, 2001 1 次提交
  27. 21 10月, 2001 1 次提交
  28. 08 9月, 2001 1 次提交
  29. 09 6月, 2001 1 次提交
  30. 01 6月, 2001 1 次提交
    • T
      Remove fastpath.c's lame attempt at caching function lookup info across · a51ec450
      Tom Lane 提交于
      calls.  This has never actually cached anything, because postgres.c does
      each fastpath call as a separate transaction command, and so fastpath.c
      would always decide that its cache was outdated.  If it had worked, it
      would now be failing for calls of oldstyle functions due to dangling
      pointers in the FmgrInfo struct.  Rip it out for simplicity and bug-
      proofing.
      a51ec450
  31. 22 3月, 2001 1 次提交
  32. 13 3月, 2001 1 次提交
    • T
      XLOG (and related) changes: · 4d14fe00
      Tom Lane 提交于
      * Store two past checkpoint locations, not just one, in pg_control.
        On startup, we fall back to the older checkpoint if the newer one
        is unreadable.  Also, a physical copy of the newest checkpoint record
        is kept in pg_control for possible use in disaster recovery (ie,
        complete loss of pg_xlog).  Also add a version number for pg_control
        itself.  Remove archdir from pg_control; it ought to be a GUC
        parameter, not a special case (not that it's implemented yet anyway).
      
      * Suppress successive checkpoint records when nothing has been entered
        in the WAL log since the last one.  This is not so much to avoid I/O
        as to make it actually useful to keep track of the last two
        checkpoints.  If the things are right next to each other then there's
        not a lot of redundancy gained...
      
      * Change CRC scheme to a true 64-bit CRC, not a pair of 32-bit CRCs
        on alternate bytes.  Polynomial borrowed from ECMA DLT1 standard.
      
      * Fix XLOG record length handling so that it will work at BLCKSZ = 32k.
      
      * Change XID allocation to work more like OID allocation.  (This is of
        dubious necessity, but I think it's a good idea anyway.)
      
      * Fix a number of minor bugs, such as off-by-one logic for XLOG file
        wraparound at the 4 gig mark.
      
      * Add documentation and clean up some coding infelicities; move file
        format declarations out to include files where planned contrib
        utilities can get at them.
      
      * Checkpoint will now occur every CHECKPOINT_SEGMENTS log segments or
        every CHECKPOINT_TIMEOUT seconds, whichever comes first.  It is also
        possible to force a checkpoint by sending SIGUSR1 to the postmaster
        (undocumented feature...)
      
      * Defend against kill -9 postmaster by storing shmem block's key and ID
        in postmaster.pid lockfile, and checking at startup to ensure that no
        processes are still connected to old shmem block (if it still exists).
      
      * Switch backends to accept SIGQUIT rather than SIGUSR1 for emergency
        stop, for symmetry with postmaster and xlog utilities.  Clean up signal
        handling in bootstrap.c so that xlog utilities launched by postmaster
        will react to signals better.
      
      * Standalone bootstrap now grabs lockfile in target directory, as added
        insurance against running it in parallel with live postmaster.
      4d14fe00
  33. 25 1月, 2001 1 次提交
  34. 14 1月, 2001 1 次提交
  35. 03 12月, 2000 1 次提交
  36. 07 10月, 2000 1 次提交
    • T
      Arrange that no database accesses are attempted during parser() --- this · fbd26d69
      Tom Lane 提交于
      took some rejiggering of typename and ACL parsing, as well as moving
      parse_analyze call out of parser().  Restructure postgres.c processing
      so that parse analysis and rewrite are skipped when in abort-transaction
      state.  Only COMMIT and ABORT statements will be processed beyond the raw
      parser() phase.  This addresses problem of parser failing with database access
      errors while in aborted state (see pghackers discussions around 7/28/00).
      Also fix some bugs with COMMIT/ABORT statements appearing in the middle of
      a single query input string.
      Function, operator, and aggregate arguments/results can now use full
      TypeName production, in particular foo[] for array types.
      DROP OPERATOR and COMMENT ON OPERATOR were broken for unary operators.
      Allow CREATE AGGREGATE to accept unquoted numeric constants for initcond.
      fbd26d69
  37. 06 9月, 2000 1 次提交
    • P
      Code cleanup of user name and user id handling in the backend. The current · 6dc24961
      Peter Eisentraut 提交于
      user is now defined in terms of the user id, the user name is only computed
      upon request (for display purposes). This is kind of the opposite of the
      previous state, which would maintain the user name and compute the user id
      for permission checks.
      
      Besides perhaps saving a few cycles (integer vs string), this now creates a
      single point of attack for changing the user id during a connection, for
      purposes of "setuid" functions, etc.
      6dc24961