1. 13 Dec, 2002 1 commit
  2. 12 Dec, 2002 1 commit
    • Tom Lane's avatar
      Phase 2 of read-only-plans project: restructure expression-tree nodes · a0bf885f
      Tom Lane authored
      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
  3. 05 Dec, 2002 2 commits
  4. 29 Nov, 2002 1 commit
  5. 23 Nov, 2002 1 commit
    • Bruce Momjian's avatar
      This patch implements FOR EACH STATEMENT triggers, per my email to · 1b7f3cc0
      Bruce Momjian authored
      -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
  6. 13 Nov, 2002 2 commits
  7. 11 Nov, 2002 2 commits
  8. 10 Nov, 2002 1 commit
  9. 09 Nov, 2002 1 commit
  10. 14 Oct, 2002 1 commit
    • Tom Lane's avatar
      Arrange to copy relcache's trigdesc structure at the start of any · 8f2a289d
      Tom Lane authored
      query that uses it.  This ensures that triggers will be applied consistently
      throughout a query even if someone commits changes to the relation's
      pg_class.reltriggers field meanwhile.  Per crash report from Laurette Cisneros.
      While at it, simplify memory management in relcache.c, which no longer
      needs the old hack to try to keep trigger info in the same place over
      a relcache entry rebuild.  (Should try to fix rd_att and rewrite-rule
      access similarly, someday.)  And make RelationBuildTriggers simpler and
      more robust by making it build the trigdesc in working memory and then
      CopyTriggerDesc() into cache memory.
      8f2a289d
  11. 23 Sep, 2002 1 commit
    • Tom Lane's avatar
      Further thinking about heap_mark4update: in HeapTupleSelfUpdated case, · 233ecca7
      Tom Lane authored
      executor should not return the tuple as successfully marked, because in
      fact it's been deleted.  Not clear that this case has ever been seen
      in practice (I think you'd have to write a SELECT FOR UPDATE that calls
      a function that deletes some row the SELECT will visit later...) but we
      should be consistent.  Also add comments to several other places that
      got it right but didn't explain what they were doing.
      233ecca7
  12. 04 Sep, 2002 1 commit
  13. 02 Sep, 2002 1 commit
    • Tom Lane's avatar
      Code review for HeapTupleHeader changes. Add version number to page headers · c7a165ad
      Tom Lane authored
      (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
  14. 29 Aug, 2002 1 commit
  15. 28 Aug, 2002 1 commit
  16. 15 Aug, 2002 1 commit
    • Bruce Momjian's avatar
      Tom Lane wrote: · b1a5f872
      Bruce Momjian authored
      > 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
  17. 07 Aug, 2002 1 commit
  18. 04 Aug, 2002 1 commit
    • Bruce Momjian's avatar
      Change messages like this: · 7312c19a
      Bruce Momjian authored
      ERROR:  ExecInsert: rejected due to CHECK constraint insert_con
      
      To be like this:
      
      ERROR:  ExecInsert: rejected due to CHECK constraint "insert_con" on
      "insert_tbl"
      
      Updated regression tests to match.
      
      I got sick of seeing 'rejected due to CHECK constraint "$1" in my log and
      not being able to find the bug in our website code...
      
      Christopher Kings-Lynne
      7312c19a
  19. 20 Jul, 2002 1 commit
    • Bruce Momjian's avatar
      oid is needed, it is added at the end of the struct (after the null · b0f5086e
      Bruce Momjian authored
      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
  20. 11 Jul, 2002 1 commit
  21. 26 Jun, 2002 2 commits
  22. 25 Jun, 2002 2 commits
    • Bruce Momjian's avatar
      Back out cleanup patch. Got old version and needs work. · e2c00704
      Bruce Momjian authored
      Neil Conway
      e2c00704
    • Bruce Momjian's avatar
      The attached patch fixes some spelling mistakes, makes the · ed275aea
      Bruce Momjian authored
      comments on one of the optimizer functions a lot more
      clear, adds a summary of the recent KSQO discussion to the
      comments in the code, adds regression tests for the bug with
      sequence state Tom fixed recently and another reg. test, and
      removes some PostQuel legacy stuff: ExecAppend -> ExecInsert,
      ExecRetrieve -> ExecSelect, etc. This was changed because the
      elog() messages from this routine are user-visible, so we
      should be using the SQL terms.
      
      Neil Conway
      ed275aea
  23. 20 Jun, 2002 1 commit
  24. 24 May, 2002 1 commit
    • Tom Lane's avatar
      Mark index entries "killed" when they are no longer visible to any · 3f4d4880
      Tom Lane authored
      transaction, so as to avoid returning them out of the index AM.  Saves
      repeated heap_fetch operations on frequently-updated rows.  Also detect
      queries on unique keys (equality to all columns of a unique index), and
      don't bother continuing scan once we have found first match.
      
      Killing is implemented in the btree and hash AMs, but not yet in rtree
      or gist, because there isn't an equally convenient place to do it in
      those AMs (the outer amgetnext routine can't do it without re-pinning
      the index page).
      
      Did some small cleanup on APIs of HeapTupleSatisfies, heap_fetch, and
      index_insert to make this a little easier.
      3f4d4880
  25. 21 May, 2002 2 commits
    • Tom Lane's avatar
      Since COPY fires triggers, it seems like a good idea for it to use · 6c6f395a
      Tom Lane authored
      a frozen (copied) snapshot too.  Move execMain's snapshot copying code
      out into a subroutine in case we find other places that need it.
      6c6f395a
    • Tom Lane's avatar
      Remove global variable scanCommandId in favor of storing a command ID · 959e61e9
      Tom Lane authored
      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
  26. 12 May, 2002 1 commit
  27. 27 Apr, 2002 2 commits
    • Tom Lane's avatar
      Support toasting of shared system relations, and provide toast tables for · c06f6a6b
      Tom Lane authored
      pg_database, pg_shadow, pg_group, all of which now have potentially-long
      fields.  Along the way, get rid of SharedSystemRelationNames list: shared
      rels are now identified in their include/pg_catalog/*.h files by a
      BKI_SHARED_RELATION macro, while indexes and toast rels inherit sharedness
      automatically from their parent table.  Fix some bugs with failure to detoast
      pg_group.grolist during ALTER GROUP.
      c06f6a6b
    • Tom Lane's avatar
      Restructure aclcheck error reporting to make permission-failure · 31c775ad
      Tom Lane authored
      messages more uniform and internationalizable: the global array
      aclcheck_error_strings[] is gone in favor of a subroutine
      aclcheck_error().  Partial implementation of namespace-related
      permission checks --- not all done yet.
      31c775ad
  28. 15 Apr, 2002 1 commit
    • Tom Lane's avatar
      The contents of command.c, creatinh.c, define.c, remove.c and rename.c · 71dc300a
      Tom Lane authored
      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
  29. 08 Apr, 2002 1 commit
  30. 31 Mar, 2002 1 commit
  31. 26 Mar, 2002 1 commit
  32. 21 Mar, 2002 2 commits
    • Tom Lane's avatar
      Change the aclchk.c routines to uniformly use OIDs to identify the · 56c9b73c
      Tom Lane authored
      objects to be privilege-checked.  Some change in their APIs would be
      necessary no matter what in the schema environment, and simply getting
      rid of the name-based interface entirely seems like the best way.
      56c9b73c
    • Tom Lane's avatar
      First phase of SCHEMA changes, concentrating on fixing the grammar and · 95ef6a34
      Tom Lane authored
      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