1. 20 Jul, 2002 2 commits
    • Tom Lane's avatar
      Tweak CreateTrigger() so that the OID used in the name of an · b70b7865
      Tom Lane authored
      RI_ConstraintTrigger is the same OID assigned to the pg_trigger row.
      This reduces consumption of OIDs and may ease debugging.
      b70b7865
    • 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
  2. 12 Jul, 2002 1 commit
    • Tom Lane's avatar
      Second phase of committing Rod Taylor's pg_depend/pg_constraint patch. · 7c6df91d
      Tom Lane authored
      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
  3. 20 Jun, 2002 1 commit
  4. 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
  5. 21 May, 2002 1 commit
    • 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
  6. 30 Apr, 2002 1 commit
  7. 27 Apr, 2002 1 commit
  8. 26 Apr, 2002 1 commit
  9. 19 Apr, 2002 1 commit
    • Tom Lane's avatar
      pg_trigger's index on tgrelid is replaced by a unique index on · 20173716
      Tom Lane authored
      (tgrelid, tgname).  This provides an additional check on trigger name
      uniqueness per-table (which was already enforced by the code anyway).
      With this change, RelationBuildTriggers will read the triggers in
      order by tgname, since it's scanning using this index.  Since a
      predictable trigger ordering has been requested for some time, document
      this behavior as a feature.  Also document that rules fire in name
      order, since yesterday's changes to pg_rewrite indexing cause that too.
      20173716
  10. 12 Apr, 2002 1 commit
  11. 09 Apr, 2002 1 commit
  12. 01 Apr, 2002 1 commit
    • Tom Lane's avatar
      Add tgconstrrelid to stored Trigger structures, make RI trigger functions · 789ddcb5
      Tom Lane authored
      depend on this rather than the trigger argument strings to locate the
      other relation to test.  This makes RI triggers function properly in
      the presence of schemas and temp tables.  Along the way, fix bogus lack
      of locking in RI triggers, handle quoting of names fully correctly,
      compute required sizes of query buffers with some semblance of accuracy.
      789ddcb5
  13. 31 Mar, 2002 1 commit
  14. 29 Mar, 2002 1 commit
  15. 26 Mar, 2002 1 commit
  16. 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
  17. 08 Mar, 2002 1 commit
  18. 06 Mar, 2002 1 commit
    • Bruce Momjian's avatar
      Change made to elog: · 92288a1c
      Bruce Momjian authored
      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
  19. 02 Mar, 2002 1 commit
    • Bruce Momjian's avatar
      Commit to match discussed elog() changes. Only update is that LOG is · a033daf5
      Bruce Momjian authored
      now just below FATAL in server_min_messages.  Added more text to
      highlight ordering difference between it and client_min_messages.
      
      ---------------------------------------------------------------------------
      
      REALLYFATAL => PANIC
      STOP => PANIC
      New INFO level the prints to client by default
      New LOG level the prints to server log by default
      Cause VACUUM information to print only to the client
      NOTICE => INFO where purely information messages are sent
      DEBUG => LOG for purely server status messages
      DEBUG removed, kept as backward compatible
      DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added
      DebugLvl removed in favor of new DEBUG[1-5] symbols
      New server_min_messages GUC parameter with values:
              DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC
      New client_min_messages GUC parameter with values:
              DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC
      Server startup now logged with LOG instead of DEBUG
      Remove debug_level GUC parameter
      elog() numbers now start at 10
      Add test to print error message if older elog() values are passed to elog()
      Bootstrap mode now has a -d that requires an argument, like postmaster
      a033daf5
  20. 19 Feb, 2002 1 commit
    • Tom Lane's avatar
      A bunch of changes aimed at reducing backend startup time... · 78634044
      Tom Lane authored
      Improve 'pg_internal.init' relcache entry preload mechanism so that it is
      safe to use for all system catalogs, and arrange to preload a realistic
      set of system-catalog entries instead of only the three nailed-in-cache
      indexes that were formerly loaded this way.  Fix mechanism for deleting
      out-of-date pg_internal.init files: this must be synchronized with transaction
      commit, not just done at random times within transactions.  Drive it off
      relcache invalidation mechanism so that no special-case tests are needed.
      
      Cache additional information in relcache entries for indexes (their pg_index
      tuples and index-operator OIDs) to eliminate repeated lookups.  Also cache
      index opclass info at the per-opclass level to avoid repeated lookups during
      relcache load.
      
      Generalize 'systable scan' utilities originally developed by Hiroshi,
      move them into genam.c, use in a number of places where there was formerly
      ugly code for choosing either heap or index scan.  In particular this allows
      simplification of the logic that prevents infinite recursion between syscache
      and relcache during startup: we can easily switch to heapscans in relcache.c
      when and where needed to avoid recursion, so IndexScanOK becomes simpler and
      does not need any expensive initialization.
      
      Eliminate useless opening of a heapscan data structure while doing an indexscan
      (this saves an mdnblocks call and thus at least one kernel call).
      78634044
  21. 15 Jan, 2002 1 commit
  22. 03 Jan, 2002 1 commit
    • Tom Lane's avatar
      Require ownership permission for CREATE INDEX, per bug report. · dc6b4deb
      Tom Lane authored
      Disallow CREATE INDEX on system catalogs, non-tables (views, sequences, etc).
      Disallow CREATE/DROP TRIGGER on system catalogs, non-tables.
      Disallow ALTER TABLE ADD/DROP CONSTRAINT on system catalogs.
      Disallow FOREIGN KEY reference to non-table.
      None of these things can actually work in the present system structure,
      but the code was letting them pass without complaint.
      dc6b4deb
  23. 16 Nov, 2001 1 commit
  24. 12 Nov, 2001 1 commit
  25. 25 Oct, 2001 1 commit
  26. 23 Aug, 2001 1 commit
  27. 10 Aug, 2001 1 commit
    • Tom Lane's avatar
      Make OIDs optional, per discussions in pghackers. WITH OIDS is still the · bf56f075
      Tom Lane authored
      default, but OIDS are removed from many system catalogs that don't need them.
      Some interesting side effects: TOAST pointers are 20 bytes not 32 now;
      pg_description has a three-column key instead of one.
      
      Bugs fixed in passing: BINARY cursors work again; pg_class.relhaspkey
      has some usefulness; pg_dump dumps comments on indexes, rules, and
      triggers in a valid order.
      
      initdb forced.
      bf56f075
  28. 02 Aug, 2001 1 commit
  29. 22 Jun, 2001 1 commit
  30. 01 Jun, 2001 1 commit
    • Tom Lane's avatar
      Clean up some minor problems exposed by further thought about Panon's bug · 0b370ea7
      Tom Lane authored
      report on old-style functions invoked by RI triggers.  We had a number of
      other places that were being sloppy about which memory context FmgrInfo
      subsidiary data will be allocated in.  Turns out none of them actually
      cause a problem in 7.1, but this is for arcane reasons such as the fact
      that old-style triggers aren't supported anyway.  To avoid getting burnt
      later, I've restructured the trigger support so that we don't keep trigger
      FmgrInfo structs in relcache memory.  Some other related cleanups too:
      it's not really necessary to call fmgr_info at all while setting up
      the index support info in relcache entries, because those ScanKeyEntry
      structs are never used to invoke the functions.  This should speed up
      relcache initialization a tiny bit.
      0b370ea7
  31. 27 May, 2001 1 commit
  32. 22 Mar, 2001 2 commits
  33. 14 Mar, 2001 1 commit
  34. 12 Mar, 2001 1 commit
  35. 27 Jan, 2001 1 commit
  36. 24 Jan, 2001 1 commit
  37. 23 Jan, 2001 1 commit
    • Tom Lane's avatar
      Fix all the places that called heap_update() and heap_delete() without · 786f1a59
      Tom Lane authored
      bothering to check the return value --- which meant that in case the
      update or delete failed because of a concurrent update, you'd not find
      out about it, except by observing later that the transaction produced
      the wrong outcome.  There are now subroutines simple_heap_update and
      simple_heap_delete that should be used anyplace that you're not prepared
      to do the full nine yards of coping with concurrent updates.  In
      practice, that seems to mean absolutely everywhere but the executor,
      because *noplace* else was checking.
      786f1a59