1. 05 11月, 2001 1 次提交
    • T
      CREATE TABLE foo (x,y,z) AS SELECT ... can't apply target column names · 5251e7b3
      Tom Lane 提交于
      to the target list in gram.y; it must wait till after expansion of the
      target list in analyze.c.  Per bug report 4-Nov:
      lx=# CREATE TABLE abc (a char, b char, c char);
      CREATE
      lx=# CREATE TABLE xyz (x, y, z) AS SELECT * FROM abc;
      ERROR:  CREATE TABLE/AS SELECT has mismatched column count
      5251e7b3
  2. 25 10月, 2001 1 次提交
  3. 19 10月, 2001 1 次提交
    • T
      Accept an INTERVAL argument for SET TIME ZONE per SQL99. · 9310075a
      Thomas G. Lockhart 提交于
       Modified the parser and the SET handlers to use full Node structures
       rather than simply a character string argument.
      Implement INTERVAL() YEAR TO MONTH (etc) syntax per SQL99.
       Does not yet accept the goofy string format that goes along with, but
       this should be fairly straight forward to fix now as a bug or later
       as a feature.
      Implement precision for the INTERVAL() type.
       Use the typmod mechanism for both of INTERVAL features.
      Fix the INTERVAL syntax in the parser:
       opt_interval was in the wrong place.
      INTERVAL is now a reserved word, otherwise we get reduce/reduce errors.
      Implement an explicit date_part() function for TIMETZ.
       Should fix coersion problem with INTERVAL reported by Peter E.
      Fix up some error messages for date/time types.
       Use all caps for type names within message.
      Fix recently introduced side-effect bug disabling 'epoch' as a recognized
       field for date_part() etc. Reported by Peter E. (??)
      Bump catalog version number.
      Rename "microseconds" current transaction time field
       from ...Msec to ...Usec. Duh!
      date/time regression tests updated for reference platform, but a few
       changes will be necessary for others.
      9310075a
  4. 03 10月, 2001 1 次提交
  5. 18 9月, 2001 1 次提交
  6. 27 8月, 2001 1 次提交
  7. 22 8月, 2001 1 次提交
    • T
      Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions in · f933766b
      Tom Lane 提交于
      pgsql-hackers.  pg_opclass now has a row for each opclass supported by each
      index AM, not a row for each opclass name.  This allows pg_opclass to show
      directly whether an AM supports an opclass, and furthermore makes it possible
      to store additional information about an opclass that might be AM-dependent.
      pg_opclass and pg_amop now store "lossy" and "haskeytype" information that we
      previously expected the user to remember to provide in CREATE INDEX commands.
      Lossiness is no longer an index-level property, but is associated with the
      use of a particular operator in a particular index opclass.
      
      Along the way, IndexSupportInitialize now uses the syscaches to retrieve
      pg_amop and pg_amproc entries.  I find this reduces backend launch time by
      about ten percent, at the cost of a couple more special cases in catcache.c's
      IndexScanOK.
      
      Initial work by Oleg Bartunov and Teodor Sigaev, further hacking by Tom Lane.
      
      initdb forced.
      f933766b
  8. 17 8月, 2001 1 次提交
    • T
      Sequences are now based on int8, not int4, arithmetic. SERIAL pseudo-type · d4f4b971
      Tom Lane 提交于
      has an alias SERIAL4 and a sister SERIAL8.  SERIAL8 is just the same
      except the created column is type int8 not int4.
      initdb forced.  Note this also breaks any chance of pg_upgrade from 7.1,
      unless we hack up pg_upgrade to drop and recreate sequences.  (Which is
      not out of the question, but I don't wanna do it.)
      d4f4b971
  9. 11 8月, 2001 1 次提交
    • T
      Make OIDs optional, per discussions in pghackers. WITH OIDS is still the · bf56f075
      Tom Lane 提交于
      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
  10. 10 8月, 2001 1 次提交
  11. 05 8月, 2001 2 次提交
  12. 17 7月, 2001 1 次提交
  13. 13 7月, 2001 1 次提交
  14. 11 7月, 2001 1 次提交
    • T
      Changes from Vince Vielhaber to allow the optional clauses of CREATE · 320b6db0
      Tom Lane 提交于
      USER and ALTER USER to appear in any order, not only the fixed order
      they used to be required to appear in.
      Also, some changes from Tom Lane to create a FULL option for VACUUM;
      it doesn't do anything yet, but I needed to change many of the same
      files to make that happen, so now seemed like a good time.
      320b6db0
  15. 20 6月, 2001 1 次提交
  16. 10 6月, 2001 1 次提交
  17. 05 6月, 2001 1 次提交
    • T
      Further work on making use of new statistics in planner. Adjust APIs · 7c579fa1
      Tom Lane 提交于
      of costsize.c routines to pass Query root, so that costsize can figure
      more things out by itself and not be so dependent on its callers to tell
      it everything it needs to know.  Use selectivity of hash or merge clause
      to estimate number of tuples processed internally in these joins
      (this is more useful than it would've been before, since eqjoinsel is
      somewhat more accurate than before).
      7c579fa1
  18. 21 5月, 2001 1 次提交
    • T
      Modify optimizer data structures so that IndexOptInfo lists built for · be03eb25
      Tom Lane 提交于
      create_index_paths are not immediately discarded, but are available for
      subsequent planner work.  This allows avoiding redundant syscache lookups
      in several places.  Change interface to operator selectivity estimation
      procedures to allow faster and more flexible estimation.
      Initdb forced due to change of pg_proc entries for selectivity functions!
      be03eb25
  19. 07 5月, 2001 1 次提交
    • T
      Rewrite of planner statistics-gathering code. ANALYZE is now available as · f905d65e
      Tom Lane 提交于
      a separate statement (though it can still be invoked as part of VACUUM, too).
      pg_statistic redesigned to be more flexible about what statistics are
      stored.  ANALYZE now collects a list of several of the most common values,
      not just one, plus a histogram (not just the min and max values).  Random
      sampling is used to make the process reasonably fast even on very large
      tables.  The number of values and histogram bins collected is now
      user-settable via an ALTER TABLE command.
      
      There is more still to do; the new stats are not being used everywhere
      they could be in the planner.  But the remaining changes for this project
      should be localized, and the behavior is already better than before.
      
      A not-very-related change is that sorting now makes use of btree comparison
      routines if it can find one, rather than invoking '<' twice.
      f905d65e
  20. 22 3月, 2001 1 次提交
  21. 25 1月, 2001 1 次提交
  22. 05 1月, 2001 1 次提交
    • T
      Remove not-really-standard implementation of CREATE TABLE's UNDER clause, · 2fb6cc90
      Tom Lane 提交于
      and revert documentation to describe the existing INHERITS clause
      instead, per recent discussion in pghackers.  Also fix implementation
      of SQL_inheritance SET variable: it is not cool to look at this var
      during the initial parsing phase, only during parse_analyze().  See
      recent bug report concerning misinterpretation of date constants just
      after a SET TIMEZONE command.  gram.y really has to be an invariant
      transformation of the query string to a raw parsetree; anything that
      can vary with time must be done during parse analysis.
      2fb6cc90
  23. 15 12月, 2000 1 次提交
    • T
      Planner speedup hacking. Avoid saving useless pathkeys, so that path · ea166f11
      Tom Lane 提交于
      comparison does not consider paths different when they differ only in
      uninteresting aspects of sort order.  (We had a special case of this
      consideration for indexscans already, but generalize it to apply to
      ordered join paths too.)  Be stricter about what is a canonical pathkey
      to allow faster pathkey comparison.  Cache canonical pathkeys and
      dispersion stats for left and right sides of a RestrictInfo's clause,
      to avoid repeated computation.  Total speedup will depend on number of
      tables in a query, but I see about 4x speedup of planning phase for
      a sample seven-table query.
      ea166f11
  24. 13 12月, 2000 1 次提交
  25. 25 11月, 2000 1 次提交
  26. 15 11月, 2000 1 次提交
    • T
      Extend CREATE DATABASE to allow selection of a template database to be · 2cf48ca0
      Tom Lane 提交于
      cloned, rather than always cloning template1.  Modify initdb to generate
      two identical databases rather than one, template0 and template1.
      Connections to template0 are disallowed, so that it will always remain
      in its virgin as-initdb'd state.  pg_dumpall now dumps databases with
      restore commands that say CREATE DATABASE foo WITH TEMPLATE = template0.
      This allows proper behavior when there is user-added data in template1.
      initdb forced!
      2cf48ca0
  27. 12 11月, 2000 1 次提交
    • T
      Restructure handling of inheritance queries so that they work with outer · 6543d81d
      Tom Lane 提交于
      joins, and clean things up a good deal at the same time.  Append plan node
      no longer hacks on rangetable at runtime --- instead, all child tables are
      given their own RT entries during planning.  Concept of multiple target
      tables pushed up into execMain, replacing bug-prone implementation within
      nodeAppend.  Planner now supports generating Append plans for inheritance
      sets either at the top of the plan (the old way) or at the bottom.  Expanding
      at the bottom is appropriate for tables used as sources, since they may
      appear inside an outer join; but we must still expand at the top when the
      target of an UPDATE or DELETE is an inheritance set, because we actually need
      a different targetlist and junkfilter for each target table in that case.
      Fortunately a target table can't be inside an outer join...  Bizarre mutual
      recursion between union_planner and prepunion.c is gone --- in fact,
      union_planner doesn't really have much to do with union queries anymore,
      so I renamed it grouping_planner.
      6543d81d
  28. 06 11月, 2000 1 次提交
  29. 05 11月, 2000 1 次提交
  30. 31 10月, 2000 1 次提交
  31. 19 10月, 2000 1 次提交
    • B
      The following patch was sent to the patches list: · 73677dd9
      Bruce Momjian 提交于
      This patch forces the use of 'DROP VIEW' to destroy views.
      
      It also changes the syntax of DROP VIEW to
      DROP VIEW v1, v2, ...
      to match the syntax of DROP TABLE.
      
      Some error messages were changed so this patch also includes changes to the
      appropriate expected/*.out files.
      
      Doc changes for 'DROP TABLE" and 'DROP VIEW' are included.
      
      
      --
      Mark Hollomon
      73677dd9
  32. 07 10月, 2000 1 次提交
    • T
      Arrange that no database accesses are attempted during parser() --- this · fbd26d69
      Tom Lane 提交于
      took some rejiggering of typename and ACL parsing, as well as moving
      parse_analyze call out of parser().  Restructure postgres.c processing
      so that parse analysis and rewrite are skipped when in abort-transaction
      state.  Only COMMIT and ABORT statements will be processed beyond the raw
      parser() phase.  This addresses problem of parser failing with database access
      errors while in aborted state (see pghackers discussions around 7/28/00).
      Also fix some bugs with COMMIT/ABORT statements appearing in the middle of
      a single query input string.
      Function, operator, and aggregate arguments/results can now use full
      TypeName production, in particular foo[] for array types.
      DROP OPERATOR and COMMENT ON OPERATOR were broken for unary operators.
      Allow CREATE AGGREGATE to accept unquoted numeric constants for initcond.
      fbd26d69
  33. 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
  34. 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
  35. 13 9月, 2000 1 次提交
  36. 12 8月, 2000 1 次提交
    • T
      copyObject() and equal() now know about all parse-time node types, · 4951a882
      Tom Lane 提交于
      including utility statements.  Still can't copy or compare executor
      state, but at present that doesn't seem to be necessary.  This makes
      it possible to execute most (all?) utility statements in plpgsql.
      Had to change parsetree representation of CreateTrigStmt so that it
      contained only legal Nodes, and not bare string constants.
      4951a882
  37. 08 8月, 2000 1 次提交
    • T
      Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist' · 62e29fe2
      Tom Lane 提交于
      from Param nodes, per discussion a few days ago on pghackers.  Add new
      expression node type FieldSelect that implements the functionality where
      it's actually needed.  Clean up some other unused fields in Func nodes
      as well.
      NOTE: initdb forced due to change in stored expression trees for rules.
      62e29fe2
  38. 22 7月, 2000 1 次提交
  39. 17 7月, 2000 1 次提交
    • T
      Revise aggregate functions per earlier discussions in pghackers. · bec98a31
      Tom Lane 提交于
      There's now only one transition value and transition function.
      NULL handling in aggregates is a lot cleaner.  Also, use Numeric
      accumulators instead of integer accumulators for sum/avg on integer
      datatypes --- this avoids overflow at the cost of being a little slower.
      Implement VARIANCE() and STDDEV() aggregates in the standard backend.
      
      Also, enable new LIKE selectivity estimators by default.  Unrelated
      change, but as long as I had to force initdb anyway...
      bec98a31