1. 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
  2. 24 11月, 2002 1 次提交
  3. 23 11月, 2002 2 次提交
    • B
      Transaction safe Truncate · d46f3de3
      Bruce Momjian 提交于
      Rod Taylor
      d46f3de3
    • 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
  4. 15 11月, 2002 1 次提交
  5. 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
  6. 10 11月, 2002 1 次提交
  7. 03 11月, 2002 1 次提交
  8. 22 10月, 2002 2 次提交
  9. 19 10月, 2002 3 次提交
  10. 29 9月, 2002 1 次提交
  11. 24 9月, 2002 1 次提交
  12. 23 9月, 2002 1 次提交
  13. 22 9月, 2002 1 次提交
    • T
      Move most of the error checking for foreign-key constraints out of · ac355d55
      Tom Lane 提交于
      parse analysis and into the execution code (in tablecmds.c).  This
      eliminates a lot of unreasonably complex code that needed to have two
      or more execution paths in case it was dealing with a not-yet-created
      table column vs. an already-existing one.  The execution code is always
      dealing with already-created tables and so needs only one case.  This
      also eliminates some potential race conditions (the table wasn't locked
      between parse analysis and execution), makes it easy to fix the gripe
      about wrong referenced-column names generating a misleading error message,
      and lets us easily add a dependency from the foreign-key constraint to
      the unique index that it requires the referenced table to have.  (Cf.
      complaint from Kris Jurka 12-Sep-2002 on pgsql-bugs.)
      
      Also, third try at building a deletion mechanism that is not sensitive
      to the order in which pg_depend entries are visited.  Adding the above-
      mentioned dependency exposed the folly of what dependency.c had been
      doing: it failed for cases where B depends on C while both auto-depend
      on A.  Dropping A should succeed in this case, but was failing if C
      happened to be visited before B.  It appears the only solution is two
      separate walks over the dependency tree.
      ac355d55
  14. 13 9月, 2002 1 次提交
  15. 06 9月, 2002 1 次提交
  16. 05 9月, 2002 1 次提交
  17. 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
  18. 31 8月, 2002 1 次提交
  19. 29 8月, 2002 2 次提交
  20. 27 8月, 2002 1 次提交
  21. 24 8月, 2002 1 次提交
    • T
      The cstring datatype can now be copied, passed around, etc. The typlen · 976246cc
      Tom Lane 提交于
      value '-2' is used to indicate a variable-width type whose width is
      computed as strlen(datum)+1.  Everything that looks at typlen is updated
      except for array support, which Joe Conway is working on; at the moment
      it wouldn't work to try to create an array of cstring.
      976246cc
  22. 22 8月, 2002 2 次提交
  23. 19 8月, 2002 1 次提交
    • T
      Remove Ident nodetype in favor of using String nodes; this fixes some · 6ebc90b0
      Tom Lane 提交于
      latent wrong-struct-type bugs and makes the coding style more uniform,
      since the majority of places working with lists of column names were
      already using Strings not Idents.  While at it, remove vestigial
      support for Stream node type, and otherwise-unreferenced nodes.h entries
      for T_TupleCount and T_BaseNode.
      NB: full recompile is recommended due to changes of Node type numbers.
      This shouldn't force an initdb though.
      6ebc90b0
  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. 05 8月, 2002 1 次提交
    • T
      Restructure system-catalog index updating logic. Instead of having · 15fe086f
      Tom Lane 提交于
      hardwired lists of index names for each catalog, use the relcache's
      mechanism for caching lists of OIDs of indexes of any table.  This
      reduces the common case of updating system catalog indexes to a single
      line, makes it much easier to add a new system index (in fact, you
      can now do so on-the-fly if you want to), and as a nice side benefit
      improves performance a little.  Per recent pghackers discussion.
      15fe086f
  27. 03 8月, 2002 1 次提交
    • T
      ALTER TABLE DROP COLUMN works. Patch by Christopher Kings-Lynne, · 38bb77a5
      Tom Lane 提交于
      code review by Tom Lane.  Remaining issues: functions that take or
      return tuple types are likely to break if one drops (or adds!)
      a column in the table defining the type.  Need to think about what
      to do here.
      
      Along the way: some code review for recent COPY changes; mark system
      columns attnotnull = true where appropriate, per discussion a month ago.
      38bb77a5
  28. 01 8月, 2002 1 次提交
    • T
      Instead of having a configure-time DEFAULT_ATTSTATTARGET, store -1 in · ce7565ab
      Tom Lane 提交于
      attstattarget to indicate 'use the default'.  The default is now a GUC
      variable default_statistics_target, and so may be changed on the fly.  Along
      the way we gain the ability to have pg_dump dump the per-column statistics
      target when it's not the default.  Patch by Neil Conway, with some kibitzing
      from Tom Lane.
      ce7565ab
  29. 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
  30. 17 7月, 2002 1 次提交
  31. 16 7月, 2002 2 次提交
  32. 13 7月, 2002 1 次提交
    • T
      Second phase of committing Rod Taylor's pg_depend/pg_constraint patch. · 7c6df91d
      Tom Lane 提交于
      pg_relcheck is gone; CHECK, UNIQUE, PRIMARY KEY, and FOREIGN KEY
      constraints all have real live entries in pg_constraint.  pg_depend
      exists, and RESTRICT/CASCADE options work on most kinds of DROP;
      however, pg_depend is not yet very well populated with dependencies.
      (Most of the ones that are present at this point just replace formerly
      hardwired associations, such as the implicit drop of a relation's pg_type
      entry when the relation is dropped.)  Need to add more logic to create
      dependency entries, improve pg_dump to dump constraints in place of
      indexes and triggers, and add some regression tests.
      7c6df91d
  33. 07 7月, 2002 1 次提交