1. 17 10月, 2000 1 次提交
  2. 06 10月, 2000 1 次提交
    • T
      Reimplementation of UNION/INTERSECT/EXCEPT. INTERSECT/EXCEPT now meet the · 05e3d0ee
      Tom Lane 提交于
      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
  3. 30 9月, 2000 1 次提交
    • T
      Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias. · 3a94e789
      Tom Lane 提交于
      (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
  4. 13 9月, 2000 1 次提交
  5. 12 9月, 2000 1 次提交
    • B
      This patch implements a different "relkind" · 264c0682
      Bruce Momjian 提交于
      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
  6. 06 9月, 2000 1 次提交
    • P
      Code cleanup of user name and user id handling in the backend. The current · 6dc24961
      Peter Eisentraut 提交于
      user is now defined in terms of the user id, the user name is only computed
      upon request (for display purposes). This is kind of the opposite of the
      previous state, which would maintain the user name and compute the user id
      for permission checks.
      
      Besides perhaps saving a few cycles (integer vs string), this now creates a
      single point of attack for changing the user id during a connection, for
      purposes of "setuid" functions, etc.
      6dc24961
  7. 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
  8. 06 8月, 2000 1 次提交
  9. 12 7月, 2000 1 次提交
  10. 06 7月, 2000 1 次提交
    • J
      Changed TOAST relations to have relkind RELKIND_TOASTVALUE. · 6534444d
      Jan Wieck 提交于
      Special handling of TOAST relations during VACUUM. TOAST relations
      are vacuumed while the lock on the master table is still active.
      The ANALYZE flag doesn't propagate to their vacuuming because the
      toaster access routines allways use index access ignoring stats, so
      why compute them at all.
      
      Protection of TOAST relations against normal INSERT/UPDATE/DELETE
      while offering SELECT for debugging purposes.
      
      Jan
      6534444d
  11. 05 7月, 2000 1 次提交
  12. 04 7月, 2000 1 次提交
    • T
      Make toast-table creation and deletion work somewhat reliably. · cdeca5f5
      Tom Lane 提交于
      Don't go through pg_exec_query_dest(), but directly to the execution
      routines.  Also, extend parameter lists so that there's no need to
      change the global setting of allowSystemTableMods, a hack that was
      certain to cause trouble in the event of any error.
      cdeca5f5
  13. 18 6月, 2000 1 次提交
    • T
      Fix performance problems with pg_index lookups (see, for example, · d03a933e
      Tom Lane 提交于
      discussion of 5/19/00).  pg_index is now searched for indexes of a
      relation using an indexscan.  Moreover, this is done once and cached
      in the relcache entry for the relation, in the form of a list of OIDs
      for the indexes.  This list is used by the parser and executor to drive
      lookups in the pg_index syscache when they want to know the properties
      of the indexes.  Net result: index information will be fully cached
      for repetitive operations such as inserts.
      d03a933e
  14. 15 6月, 2000 1 次提交
  15. 10 6月, 2000 1 次提交
  16. 30 5月, 2000 1 次提交
  17. 29 5月, 2000 1 次提交
  18. 13 4月, 2000 1 次提交
  19. 07 4月, 2000 2 次提交
  20. 09 3月, 2000 1 次提交
  21. 15 2月, 2000 1 次提交
  22. 03 2月, 2000 1 次提交
  23. 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
  24. 20 1月, 2000 1 次提交
    • T
      Fix handling of NULL constraint conditions: per SQL92 spec, a NULL result · 6d1efd76
      Tom Lane 提交于
      from a constraint condition does not violate the constraint (cf. discussion
      on pghackers 12/9/99).  Implemented by adding a parameter to ExecQual,
      specifying whether to return TRUE or FALSE when the qual result is
      really NULL in three-valued boolean logic.  Currently, ExecRelCheck is
      the only caller that asks for TRUE, but if we find any other places that
      have the wrong response to NULL, it'll be easy to fix them.
      6d1efd76
  25. 18 1月, 2000 1 次提交
  26. 06 1月, 2000 1 次提交
  27. 17 12月, 1999 1 次提交
  28. 10 12月, 1999 1 次提交
  29. 24 11月, 1999 1 次提交
  30. 08 11月, 1999 1 次提交
  31. 01 11月, 1999 1 次提交
  32. 31 10月, 1999 1 次提交
    • T
      Avoid duplicate ExecTypeFromTL() call in ExecInitJunkFilter() by passing · 5b9d655b
      Tom Lane 提交于
      in the TupleDesc that the caller already has (for call from ExecMain) or
      can make just as easily as ExecInitJunkFilter() can (for call from
      ExecAppend).  Also, don't bother to build a junk filter for an INSERT
      operation that doesn't actually need one, which is the normal case.
      5b9d655b
  33. 07 10月, 1999 1 次提交
    • T
      Fix planner and rewriter to follow SQL semantics for tables that are · 3eb1c822
      Tom Lane 提交于
      mentioned in FROM but not elsewhere in the query: such tables should be
      joined over anyway.  Aside from being more standards-compliant, this allows
      removal of some very ugly hacks for COUNT(*) processing.  Also, allow
      HAVING clause without aggregate functions, since SQL does.  Clean up
      CREATE RULE statement-list syntax the same way Bruce just fixed the
      main stmtmulti production.
      CAUTION: addition of a field to RangeTblEntry nodes breaks stored rules;
      you will have to initdb if you have any rules.
      3eb1c822
  34. 30 9月, 1999 1 次提交
    • J
      This is part #1 for of the DEFERRED CONSTRAINT TRIGGER support. · 1547ee01
      Jan Wieck 提交于
      Implements the CREATE CONSTRAINT TRIGGER and SET CONSTRAINTS commands.
      
      TODO:
          Generic builtin trigger procedures
          Automatic execution of appropriate CREATE CONSTRAINT... at CREATE TABLE
          Support of new trigger type in pg_dump
          Swapping of huge # of events to disk
      
      Jan
      1547ee01
  35. 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
  36. 19 9月, 1999 1 次提交
    • T
      Mega-commit to make heap_open/heap_openr/heap_close take an · bd272cac
      Tom Lane 提交于
      additional argument specifying the kind of lock to acquire/release (or
      'NoLock' to do no lock processing).  Ensure that all relations are locked
      with some appropriate lock level before being examined --- this ensures
      that relevant shared-inval messages have been processed and should prevent
      problems caused by concurrent VACUUM.  Fix several bugs having to do with
      mismatched increment/decrement of relation ref count and mismatched
      heap_open/close (which amounts to the same thing).  A bogus ref count on
      a relation doesn't matter much *unless* a SI Inval message happens to
      arrive at the wrong time, which is probably why we got away with this
      sloppiness for so long.  Repair missing grab of AccessExclusiveLock in
      DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi.
      Recommend 'make clean all' after pulling this update; I modified the
      Relation struct layout slightly.
      Will post further discussion to pghackers list shortly.
      bd272cac
  37. 18 7月, 1999 1 次提交
  38. 16 7月, 1999 2 次提交