1. 05 Aug, 2002 1 commit
    • Tom Lane's avatar
      Restructure system-catalog index updating logic. Instead of having · 15fe086f
      Tom Lane authored
      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
  2. 02 Aug, 2002 1 commit
    • Tom Lane's avatar
      ALTER TABLE DROP COLUMN works. Patch by Christopher Kings-Lynne, · 38bb77a5
      Tom Lane authored
      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
  3. 16 Jul, 2002 1 commit
    • Tom Lane's avatar
      Add code to extract dependencies from an expression tree, and use it · 30ec3160
      Tom Lane authored
      to build dependencies for rules, constraint expressions, and default
      expressions.  Repair some problems in the original design of
      recursiveDeletion() exposed by more complex dependency sets.  Fix
      regression tests that were deleting things in illegal sequences.
      30ec3160
  4. 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
  5. 20 Jun, 2002 1 commit
  6. 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
  7. 20 May, 2002 1 commit
    • Tom Lane's avatar
      Restructure indexscan API (index_beginscan, index_getnext) per · 44fbe20d
      Tom Lane authored
      yesterday's proposal to pghackers.  Also remove unnecessary parameters
      to heap_beginscan, heap_rescan.  I modified pg_proc.h to reflect the
      new numbers of parameters for the AM interface routines, but did not
      force an initdb because nothing actually looks at those fields.
      44fbe20d
  8. 12 May, 2002 1 commit
  9. 27 Apr, 2002 1 commit
  10. 19 Apr, 2002 1 commit
  11. 18 Apr, 2002 1 commit
    • Tom Lane's avatar
      Rule names are now unique per-relation, rather than unique globally. · b3120804
      Tom Lane authored
      DROP RULE and COMMENT ON RULE syntax adds an 'ON tablename' clause,
      similar to TRIGGER syntaxes.  To allow loading of existing pg_dump
      files containing COMMENT ON RULE, the COMMENT code will still accept
      the old syntax --- but only if the target rulename is unique across
      the whole database.
      b3120804
  12. 26 Mar, 2002 1 commit
  13. 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
  14. 12 Aug, 2001 1 commit
  15. 03 May, 2001 1 commit
  16. 23 Mar, 2001 1 commit
  17. 22 Mar, 2001 2 commits
  18. 24 Jan, 2001 1 commit
  19. 13 Jan, 2001 1 commit
  20. 05 Dec, 2000 1 commit
    • Tom Lane's avatar
      Repair breakage of rules containing INSERT ... SELECT actions, per bug · a51f004d
      Tom Lane authored
      report from Joel Burton.  Turns out that my simple idea of turning the
      SELECT into a subquery does not interact well *at all* with the way the
      rule rewriter works.  Really what we need to make INSERT ... SELECT work
      cleanly is to decouple targetlists from rangetables: an INSERT ... SELECT
      wants to have two levels of targetlist but only one rangetable.  No time
      for that for 7.1, however, so I've inserted some ugly hacks to make the
      rewriter know explicitly about the structure of INSERT ... SELECT queries.
      Ugh :-(
      a51f004d
  21. 26 Oct, 2000 1 commit
  22. 05 Oct, 2000 1 commit
    • Tom Lane's avatar
      Reimplementation of UNION/INTERSECT/EXCEPT. INTERSECT/EXCEPT now meet the · 05e3d0ee
      Tom Lane authored
      SQL92 semantics, including support for ALL option.  All three can be used
      in subqueries and views.  DISTINCT and ORDER BY work now in views, too.
      This rewrite fixes many problems with cross-datatype UNIONs and INSERT/SELECT
      where the SELECT yields different datatypes than the INSERT needs.  I did
      that by making UNION subqueries and SELECT in INSERT be treated like
      subselects-in-FROM, thereby allowing an extra level of targetlist where the
      datatype conversions can be inserted safely.
      INITDB NEEDED!
      05e3d0ee
  23. 29 Sep, 2000 1 commit
    • Tom Lane's avatar
      Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias. · 3a94e789
      Tom Lane authored
      (Don't forget that an alias is required.)  Views reimplemented as expanding
      to subselect-in-FROM.  Grouping, aggregates, DISTINCT in views actually
      work now (he says optimistically).  No UNION support in subselects/views
      yet, but I have some ideas about that.  Rule-related permissions checking
      moved out of rewriter and into executor.
      INITDB REQUIRED!
      3a94e789
  24. 12 Sep, 2000 3 commits
    • Tom Lane's avatar
      Fix relation-to-view conversion so that it doesn't try to convert a plain · 39ee0f55
      Tom Lane authored
      relation to a view when you create an ON INSERT/UPDATE/DELETE rule ...
      39ee0f55
    • Bruce Momjian's avatar
      This patch implements a different "relkind" · 264c0682
      Bruce Momjian authored
      for views. Views are now have a "relkind" of
      RELKIND_VIEW instead of RELKIND_RELATION.
      
      Also, views no longer have actual heap storage
      files.
      
      The following changes were made
      
      1. CREATE VIEW sets the new relkind
      
      2. The executor complains if a DELETE or
              INSERT references a view.
      
      3. DROP RULE complains if an attempt is made
              to delete a view SELECT rule.
      
      4. CREATE RULE "_RETmytable" AS ON SELECT TO mytable DO INSTEAD ...
              1. checks to make sure mytable is empty.
              2. sets the relkind to RELKIND_VIEW.
              3. deletes the heap storage files.
      5. LOCK myview is not allowed. :)
      
      
      6. the regression test type_sanity was changed to
              account for the new relkind value.
      
      7. CREATE INDEX ON myview ... is not allowed.
      
      8. VACUUM myview is not allowed.
              VACUUM automatically skips views when do the entire
              database.
      
      9. TRUNCATE myview is not allowed.
      
      
      THINGS LEFT TO THINK ABOUT
      
      o pg_views
      
      o pg_dump
      
      o pgsql (\d \dv)
      o Do we really want to be able to inherit from views?
      
      o Is 'DROP TABLE myview' OK?
      
      --
      Mark Hollomon
      264c0682
    • Bruce Momjian's avatar
      O.K. - · 0ba0e321
      Bruce Momjian authored
      Here's the multibyte aware version of my patch to fix the truncation
      of the rulename autogenerated during a CREATE VIEW. I've modified all
      the places in the backend that want to construct the rulename to use
      the MakeRetrieveViewRuleName(), where I put the #ifdef MULTIBYTE, so
      that's the only place that knows how to construct a view rulename. Except
      pg_dump, where I replicated the code, since it's a standalone binary.
      
      The only effect the enduser will see is that views with names len(name)
      > NAMEDATALEN-4 will fail to be created, if the derived rulename clases
      with an existing rule: i.e. the user is trying to create two views with
      long names whose first difference is past NAMEDATALEN-4 (but before
      NAMEDATALEN: that'll error out after the viewname truncation.) In no
      case will the user get left with a table without a view rule, as the
      current code does.
      
      Ross Reedstrom
      0ba0e321
  25. 30 Jul, 2000 1 commit
    • Tom Lane's avatar
      Type lztext is toast. · 8f9fa0e1
      Tom Lane authored
      (Sorry, couldn't help it...)
      
      Removed type filename as well, since it's unused and probably useless.
      INITDB FORCED, because pg_rewrite columns are now plain text again.
      8f9fa0e1
  26. 30 Jun, 2000 1 commit
    • Tom Lane's avatar
      Use a private memory context to store rule information in each relcache · b41f4ab8
      Tom Lane authored
      entry that has rules.  This allows us to release the rule parsetrees
      on relcache flush without needing a working freeObject() routine.
      Formerly, the rule trees were leaked permanently at relcache flush.
      Also, clean up handling of rule creation and deletion --- there was
      not sufficient locking of the relation being modified, and there was
      no reliable notification of other backends that a relcache reload
      was needed.  Also, clean up relcache.c code so that scans of system
      tables needed to load a relcache entry are done in the caller's
      memory context, not in CacheMemoryContext.  This prevents any
      un-pfreed memory from those scans from becoming a permanent memory
      leak.
      b41f4ab8
  27. 28 Jun, 2000 1 commit
    • Tom Lane's avatar
      First phase of memory management rewrite (see backend/utils/mmgr/README · 1aebc361
      Tom Lane authored
      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
  28. 15 Jun, 2000 1 commit
  29. 30 May, 2000 1 commit
  30. 12 Apr, 2000 1 commit
  31. 26 Feb, 2000 1 commit
  32. 27 Jan, 2000 1 commit
    • Tom Lane's avatar
      Redesign DISTINCT ON as discussed in pgsql-sql 1/25/00: syntax is now · dd979f66
      Tom Lane authored
      SELECT DISTINCT ON (expr [, expr ...]) targetlist ...
      and there is a check to make sure that the user didn't specify an ORDER BY
      that's incompatible with the DISTINCT operation.
      Reimplement nodeUnique and nodeGroup to use the proper datatype-specific
      equality function for each column being compared --- they used to do
      bitwise comparisons or convert the data to text strings and strcmp().
      (To add insult to injury, they'd look up the conversion functions once
      for each tuple...)  Parse/plan representation of DISTINCT is now a list
      of SortClause nodes.
      initdb forced by querytree change...
      dd979f66
  33. 26 Jan, 2000 1 commit
    • Bruce Momjian's avatar
      Add: · 5c25d602
      Bruce Momjian authored
        * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
      
      to all files copyright Regents of Berkeley.  Man, that's a lot of files.
      5c25d602
  34. 18 Nov, 1999 1 commit
  35. 07 Nov, 1999 1 commit
  36. 21 Oct, 1999 1 commit