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. 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. 16 12月, 2002 1 次提交
  4. 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
  5. 18 11月, 2002 1 次提交
  6. 05 9月, 2002 1 次提交
  7. 21 6月, 2002 1 次提交
  8. 18 5月, 2002 1 次提交
  9. 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
  10. 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
  11. 06 3月, 2002 1 次提交
    • B
      Change made to elog: · 92288a1c
      Bruce Momjian 提交于
      o  Change all current CVS messages of NOTICE to WARNING.  We were going
      to do this just before 7.3 beta but it has to be done now, as you will
      see below.
      
      o Change current INFO messages that should be controlled by
      client_min_messages to NOTICE.
      
      o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc.
      to always go to the client.
      
      o Remove INFO from the client_min_messages options and add NOTICE.
      
      Seems we do need three non-ERROR elog levels to handle the various
      behaviors we need for these messages.
      
      Regression passed.
      92288a1c
  12. 28 2月, 2002 2 次提交
    • T
      Paranoia about data structure lifetime ... · 04cb9a6a
      Tom Lane 提交于
      04cb9a6a
    • 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
  13. 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
  14. 25 10月, 2001 1 次提交
  15. 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
  16. 22 3月, 2001 2 次提交
  17. 28 2月, 2001 1 次提交
    • T
      Tweak portal (cursor) code so that it will not call the executor again · 778a21ca
      Tom Lane 提交于
      when user does another FETCH after reaching end of data, or another
      FETCH backwards after reaching start.  This is needed because some plan
      nodes are not very robust about being called again after they've already
      returned NULL; for example, MergeJoin will crash in some states but not
      others.  While the ideal approach would be for them all to handle this
      correctly, it seems foolish to assume that no such bugs would creep in
      again once cleaned up.  Therefore, the most robust answer is to prevent
      the situation from arising at all.
      778a21ca
  18. 25 1月, 2001 1 次提交
  19. 12 11月, 2000 1 次提交
    • T
      Restructure handling of inheritance queries so that they work with outer · 6543d81d
      Tom Lane 提交于
      joins, and clean things up a good deal at the same time.  Append plan node
      no longer hacks on rangetable at runtime --- instead, all child tables are
      given their own RT entries during planning.  Concept of multiple target
      tables pushed up into execMain, replacing bug-prone implementation within
      nodeAppend.  Planner now supports generating Append plans for inheritance
      sets either at the top of the plan (the old way) or at the bottom.  Expanding
      at the bottom is appropriate for tables used as sources, since they may
      appear inside an outer join; but we must still expand at the top when the
      target of an UPDATE or DELETE is an inheritance set, because we actually need
      a different targetlist and junkfilter for each target table in that case.
      Fortunately a target table can't be inside an outer join...  Bizarre mutual
      recursion between union_planner and prepunion.c is gone --- in fact,
      union_planner doesn't really have much to do with union queries anymore,
      so I renamed it grouping_planner.
      6543d81d
  20. 27 10月, 2000 1 次提交
  21. 22 8月, 2000 1 次提交
    • T
      Fix a many-legged critter reported by chifungfan@yahoo.com: under the · 0147b193
      Tom Lane 提交于
      right circumstances a hash join executed as a DECLARE CURSOR/FETCH
      query would crash the backend.  Problem as seen in current sources was
      that the hash tables were stored in a context that was a child of
      TransactionCommandContext, which got zapped at completion of the FETCH
      command --- but cursor cleanup executed at COMMIT expected the tables
      to still be valid.  I haven't chased down the details as seen in 7.0.*
      but I'm sure it's the same general problem.
      0147b193
  22. 17 7月, 2000 1 次提交
    • T
      Revise aggregate functions per earlier discussions in pghackers. · bec98a31
      Tom Lane 提交于
      There's now only one transition value and transition function.
      NULL handling in aggregates is a lot cleaner.  Also, use Numeric
      accumulators instead of integer accumulators for sum/avg on integer
      datatypes --- this avoids overflow at the cost of being a little slower.
      Implement VARIANCE() and STDDEV() aggregates in the standard backend.
      
      Also, enable new LIKE selectivity estimators by default.  Unrelated
      change, but as long as I had to force initdb anyway...
      bec98a31
  23. 12 7月, 2000 1 次提交
  24. 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
  25. 12 6月, 2000 1 次提交
  26. 09 6月, 2000 1 次提交
    • B
      I have large database and with this DB work more users and I very need · 85add42a
      Bruce Momjian 提交于
      more restriction for fretful users. The current PG allow define only
      NO-CREATE-DB and NO-CREATE-USER restriction, but for some users I need
      NO-CREATE-TABLE and NO-LOCK-TABLE.
      
      This patch add to current code NOCREATETABLE and NOLOCKTABLE feature:
      
      CREATE USER username
          [ WITH
           [ SYSID uid ]
           [ PASSWORD 'password' ] ]
          [ CREATEDB   | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]
      ->  [ CREATETABLE | NOCREATETABLE ] [ LOCKTABLE | NOLOCKTABLE ]
          ...etc.
      
       If CREATETABLE or LOCKTABLE is not specific in CREATE USER command,
      as default is set CREATETABLE or LOCKTABLE (true).
      
       A user with NOCREATETABLE restriction can't call CREATE TABLE or
      SELECT INTO commands, only create temp table is allow for him.
      
                                                      Karel
      85add42a
  27. 05 6月, 2000 1 次提交
  28. 04 6月, 2000 1 次提交
  29. 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
  30. 20 12月, 1999 1 次提交
  31. 24 9月, 1999 1 次提交
    • T
      Several changes here, not very related but touching some of the same files. · e812458b
      Tom Lane 提交于
      * Buffer refcount cleanup (per my "progress report" to pghackers, 9/22).
      * Add links to backend PROC structs to sinval's array of per-backend info,
      and use these links for routines that need to check the state of all
      backends (rather than the slow, complicated search of the ShmemIndex
      hashtable that was used before).  Add databaseOID to PROC structs.
      * Use this to implement an interlock that prevents DESTROY DATABASE of
      a database containing running backends.  (It's a little tricky to prevent
      a concurrently-starting backend from getting in there, since the new
      backend is not able to lock anything at the time it tries to look up
      its database in pg_database.  My solution is to recheck that the DB is
      OK at the end of InitPostgres.  It may not be a 100% solution, but it's
      a lot better than no interlock at all...)
      * In ALTER TABLE RENAME, flush buffers for the relation before doing the
      rename of the physical files, to ensure we don't get failures later from
      mdblindwrt().
      * Update TRUNCATE patch so that it actually compiles against current
      sources :-(.
      You should do "make clean all" after pulling these changes.
      e812458b
  32. 18 7月, 1999 1 次提交
  33. 16 7月, 1999 2 次提交
  34. 15 7月, 1999 1 次提交
  35. 26 5月, 1999 1 次提交
  36. 23 3月, 1999 1 次提交
  37. 14 2月, 1999 1 次提交