1. 15 10月, 2002 1 次提交
  2. 23 9月, 2002 1 次提交
  3. 19 9月, 2002 1 次提交
    • T
      Extend pg_cast castimplicit column to a three-way value; this allows us · b26dfb95
      Tom Lane 提交于
      to be flexible about assignment casts without introducing ambiguity in
      operator/function resolution.  Introduce a well-defined promotion hierarchy
      for numeric datatypes (int2->int4->int8->numeric->float4->float8).
      Change make_const to initially label numeric literals as int4, int8, or
      numeric (never float8 anymore).
      Explicitly mark Func and RelabelType nodes to indicate whether they came
      from a function call, explicit cast, or implicit cast; use this to do
      reverse-listing more accurately and without so many heuristics.
      Explicit casts to char, varchar, bit, varbit will truncate or pad without
      raising an error (the pre-7.2 behavior), while assigning to a column without
      any explicit cast will still raise an error for wrong-length data like 7.3.
      This more nearly follows the SQL spec than 7.2 behavior (we should be
      reporting a 'completion condition' in the explicit-cast cases, but we have
      no mechanism for that, so just do silent truncation).
      Fix some problems with enforcement of typmod for array elements;
      it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
      Provide a generalized array_length_coerce() function to replace the
      specialized per-array-type functions that used to be needed (and were
      missing for NUMERIC as well as all the datetime types).
      Add missing conversions int8<->float4, text<->numeric, oid<->int8.
      initdb forced.
      b26dfb95
  4. 05 9月, 2002 1 次提交
  5. 01 9月, 2002 1 次提交
    • T
      Code review for domain-constraints patch. Use a new ConstraintTest node · 845a6c3a
      Tom Lane 提交于
      type for runtime constraint checks, instead of misusing the parse-time
      Constraint node for the purpose.  Fix some damage introduced into type
      coercion logic; in particular ensure that a coerced expression tree will
      read out the correct result type when inspected (patch had broken some
      RelabelType cases).  Enforce domain NOT NULL constraints against columns
      that are omitted from an INSERT.
      845a6c3a
  6. 31 8月, 2002 1 次提交
  7. 29 8月, 2002 1 次提交
  8. 27 8月, 2002 1 次提交
    • T
      Modify array operations to include array's element type OID in the · 5cabcfcc
      Tom Lane 提交于
      array header, and to compute sizing and alignment of array elements
      the same way normal tuple access operations do --- viz, using the
      tupmacs.h macros att_addlength and att_align.  This makes the world
      safe for arrays of cstrings or intervals, and should make it much
      easier to write array-type-polymorphic functions; as examples see
      the cleanups of array_out and contrib/array_iterator.  By Joe Conway
      and Tom Lane.
      5cabcfcc
  9. 19 8月, 2002 1 次提交
    • T
      Remove Ident nodetype in favor of using String nodes; this fixes some · 6ebc90b0
      Tom Lane 提交于
      latent wrong-struct-type bugs and makes the coding style more uniform,
      since the majority of places working with lists of column names were
      already using Strings not Idents.  While at it, remove vestigial
      support for Stream node type, and otherwise-unreferenced nodes.h entries
      for T_TupleCount and T_BaseNode.
      NB: full recompile is recommended due to changes of Node type numbers.
      This shouldn't force an initdb though.
      6ebc90b0
  10. 11 8月, 2002 1 次提交
    • B
      > create view pg_locks as select l.relation, l.database, l.backendpid, · 0d916a4b
      Bruce Momjian 提交于
       > l.mode, l.isgranted from pg_lock_info() as l(relation oid, database oid,
       > backendpid int4, mode text, isgranted bool);
       > ERROR:  badly formatted planstring "COLUMNDEF "...
       >
      
      Reported by Neil Conway -- I never implemented readfuncs.c support for
      ColumnDef or TypeName, which is needed so that views can be created on
      functions returning type RECORD. Here's a patch.
      
      Joe Conway
      0d916a4b
  11. 05 8月, 2002 1 次提交
    • B
      Attached are two patches to implement and document anonymous composite · 9218689b
      Bruce Momjian 提交于
      types for Table Functions, as previously proposed on HACKERS. Here is a
      brief explanation:
      
      1. Creates a new pg_type typtype: 'p' for pseudo type (currently either
           'b' for base or 'c' for catalog, i.e. a class).
      
      2. Creates new builtin type of typtype='p' named RECORD. This is the
           first of potentially several pseudo types.
      
      3. Modify FROM clause grammer to accept:
           SELECT * FROM my_func() AS m(colname1 type1, colname2 type1, ...)
           where m is the table alias, colname1, etc are the column names, and
           type1, etc are the column types.
      
      4. When typtype == 'p' and the function return type is RECORD, a list
           of column defs is required, and when typtype != 'p', it is
      disallowed.
      
      5. A check was added to ensure that the tupdesc provide via the parser
           and the actual return tupdesc match in number and type of
      attributes.
      
      When creating a function you can do:
           CREATE FUNCTION foo(text) RETURNS setof RECORD ...
      
      When using it you can do:
           SELECT * from foo(sqlstmt) AS (f1 int, f2 text, f3 timestamp)
             or
           SELECT * from foo(sqlstmt) AS f(f1 int, f2 text, f3 timestamp)
             or
           SELECT * from foo(sqlstmt) f(f1 int, f2 text, f3 timestamp)
      
      Included in the patches are adjustments to the regression test sql and
      expected files, and documentation.
      
      p.s.
           This potentially solves (or at least improves) the issue of builtin
           Table Functions. They can be bootstrapped as returning RECORD, and
           we can wrap system views around them with properly specified column
           defs. For example:
      
           CREATE VIEW pg_settings AS
             SELECT s.name, s.setting
             FROM show_all_settings()AS s(name text, setting text);
      
           Then we can also add the UPDATE RULE that I previously posted to
           pg_settings, and have pg_settings act like a virtual table, allowing
           settings to be queried and set.
      
      
      Joe Conway
      9218689b
  12. 19 7月, 2002 1 次提交
  13. 18 7月, 2002 1 次提交
    • B
      Finished the Between patch Christopher started. · 3e22406e
      Bruce Momjian 提交于
      Implements between (symmetric / asymmetric) as a node.
      
      Executes the left or right expression once, makes a Const out of the
      resulting Datum and executes the >=, <= portions out of the Const sets.
      
      Of course, the parser does a fair amount of preparatory work for this to
      happen.
      
      Rod Taylor
      3e22406e
  14. 17 7月, 2002 1 次提交
  15. 13 7月, 2002 1 次提交
    • T
      Second phase of committing Rod Taylor's pg_depend/pg_constraint patch. · 7c6df91d
      Tom Lane 提交于
      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
  16. 04 7月, 2002 1 次提交
    • T
      Implement the IS DISTINCT FROM operator per SQL99. · 68d9fbeb
      Thomas G. Lockhart 提交于
      Reused the Expr node to hold DISTINCT which strongly resembles
       the existing OP info. Define DISTINCT_EXPR which strongly resembles
       the existing OPER_EXPR opType, but with handling for NULLs required
       by SQL99.
      We have explicit support for single-element DISTINCT comparisons
       all the way through to the executor. But, multi-element DISTINCTs
       are handled by expanding into a comparison tree in gram.y as is done for
       other row comparisons. Per discussions, it might be desirable to move
       this into one or more purpose-built nodes to be handled in the backend.
      Define the optional ROW keyword and token per SQL99.
       This allows single-element row constructs, which were formerly disallowed
       due to shift/reduce conflicts with parenthesized a_expr clauses.
      Define the SQL99 TREAT() function. Currently, use as a synonym for CAST().
      68d9fbeb
  17. 21 6月, 2002 1 次提交
  18. 13 5月, 2002 2 次提交
  19. 29 4月, 2002 1 次提交
    • T
      Second try at fixing join alias variables. Instead of attaching miscellaneous · 6c598869
      Tom Lane 提交于
      lists to join RTEs, attach a list of Vars and COALESCE expressions that will
      replace the join's alias variables during planning.  This simplifies
      flatten_join_alias_vars while still making it easy to fix up varno references
      when transforming the query tree.  Add regression test cases for interactions
      of subqueries with outer joins.
      6c598869
  20. 18 4月, 2002 1 次提交
    • T
      Opclasses live in namespaces. I also took the opportunity to create · 27a54ae2
      Tom Lane 提交于
      an 'opclass owner' column in pg_opclass.  Nothing is done with it at
      present, but since there are plans to invent a CREATE OPERATOR CLASS
      command soon, we'll probably want DROP OPERATOR CLASS too, which
      suggests that a notion of ownership would be a good idea.
      27a54ae2
  21. 17 4月, 2002 1 次提交
    • T
      Operators live in namespaces. CREATE/DROP/COMMENT ON OPERATOR take · 6cef5d25
      Tom Lane 提交于
      qualified operator names directly, for example CREATE OPERATOR myschema.+
      ( ... ).  To qualify an operator name in an expression you need to write
      OPERATOR(myschema.+) (thanks to Peter for suggesting an escape hatch).
      I also took advantage of having to reformat pg_operator to fix something
      that'd been bugging me for a while: mergejoinable operators should have
      explicit links to the associated cross-data-type comparison operators,
      rather than hardwiring an assumption that they are named < and >.
      6cef5d25
  22. 12 4月, 2002 1 次提交
    • T
      Restructure representation of aggregate functions so that they have pg_proc · 902a6a0a
      Tom Lane 提交于
      entries, per pghackers discussion.  This fixes aggregates to live in
      namespaces, and also simplifies/speeds up lookup in parse_func.c.
      Also, add a 'proimplicit' flag to pg_proc that controls whether a type
      coercion function may be invoked implicitly, or only explicitly.  The
      current settings of these flags are more permissive than I would like,
      but we will need to debate and refine the behavior; for now, I avoided
      breaking regression tests as much as I could.
      902a6a0a
  23. 10 4月, 2002 1 次提交
  24. 30 3月, 2002 1 次提交
  25. 22 3月, 2002 2 次提交
    • T
      A little further progress on schemas: push down RangeVars into · 108a0ec8
      Tom Lane 提交于
      addRangeTableEntry calls.  Remove relname field from RTEs, since
      it will no longer be a useful unique identifier of relations;
      we want to encourage people to rely on the relation OID instead.
      Further work on dumping qual expressions in EXPLAIN, too.
      108a0ec8
    • T
      First phase of SCHEMA changes, concentrating on fixing the grammar and · 95ef6a34
      Tom Lane 提交于
      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
  26. 12 3月, 2002 1 次提交
    • T
      Restructure representation of join alias variables. An explicit JOIN · 6eeb95f0
      Tom Lane 提交于
      now has an RTE of its own, and references to its outputs now are Vars
      referencing the JOIN RTE, rather than CASE-expressions.  This allows
      reverse-listing in ruleutils.c to use the correct alias easily, rather
      than painfully reverse-engineering the alias namespace as it used to do.
      Also, nested FULL JOINs work correctly, because the result of the inner
      joins are simple Vars that the planner can cope with.  This fixes a bug
      reported a couple times now, notably by Tatsuo on 18-Nov-01.  The alias
      Vars are expanded into COALESCE expressions where needed at the very end
      of planning, rather than during parsing.
      Also, beginnings of support for showing plan qualifier expressions in
      EXPLAIN.  There are probably still cases that need work.
      initdb forced due to change of stored-rule representation.
      6eeb95f0
  27. 06 3月, 2002 1 次提交
    • B
      Change made to elog: · 92288a1c
      Bruce Momjian 提交于
      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
  28. 25 10月, 2001 2 次提交
  29. 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
  30. 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
  31. 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
  32. 20 6月, 2001 1 次提交
  33. 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
  34. 22 3月, 2001 1 次提交
  35. 25 1月, 2001 1 次提交
  36. 20 1月, 2001 1 次提交
  37. 08 1月, 2001 1 次提交