1. 15 10月, 2002 1 次提交
  2. 11 10月, 2002 2 次提交
  3. 23 9月, 2002 1 次提交
  4. 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
  5. 05 9月, 2002 1 次提交
  6. 02 9月, 2002 2 次提交
  7. 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
  8. 31 8月, 2002 1 次提交
  9. 29 8月, 2002 1 次提交
  10. 27 8月, 2002 2 次提交
  11. 24 8月, 2002 1 次提交
    • T
      The cstring datatype can now be copied, passed around, etc. The typlen · 976246cc
      Tom Lane 提交于
      value '-2' is used to indicate a variable-width type whose width is
      computed as strlen(datum)+1.  Everything that looks at typlen is updated
      except for array support, which Joe Conway is working on; at the moment
      it wouldn't work to try to create an array of cstring.
      976246cc
  12. 19 8月, 2002 3 次提交
  13. 16 8月, 2002 1 次提交
    • B
      Tom Lane wrote: · b1a5f872
      Bruce Momjian 提交于
      > There's no longer a separate call to heap_storage_create in that routine
      > --- the right place to make the test is now in the storage_create
      > boolean parameter being passed to heap_create.  A simple change, but
      > it passeth patch's understanding ...
      
      Thanks.
      
      Attached is a patch against cvs tip as of 8:30 PM PST or so. Turned out
      that even after fixing the failed hunks, there was a new spot in
      bufmgr.c which needed to be fixed (related to temp relations;
      RelationUpdateNumberOfBlocks). But thankfully the regression test code
      caught it :-)
      
      Joe Conway
      b1a5f872
  14. 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
  15. 05 8月, 2002 3 次提交
    • T
      1be01431
    • B
    • 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
  16. 04 8月, 2002 1 次提交
    • B
      The attached patch implements START TRANSACTION, per SQL99. The · 19e0e35b
      Bruce Momjian 提交于
      functionality of the command is basically identical to that of
      BEGIN; it just accepts a few extra options (only one of which
      PostgreSQL currently implements), and is standards-compliant.
      The patch includes a simple regression test and documentation.
      
      [ Regression tests removed, per Peter.]
      
      Neil Conway
      19e0e35b
  17. 30 7月, 2002 1 次提交
    • T
      Implement CREATE/DROP OPERATOR CLASS. Work still remains: need more · ea4686e3
      Tom Lane 提交于
      documentation (xindex.sgml should be rewritten), need to teach pg_dump
      about it, need to update contrib modules that currently build pg_opclass
      entries by hand.  Original patch by Bill Studenmund, grammar adjustments
      and general update for 7.3 by Tom Lane.
      ea4686e3
  18. 25 7月, 2002 1 次提交
    • P
      Remove unused system table columns: · 739adf32
      Peter Eisentraut 提交于
      pg_language.lancompiler
      pg_operator.oprprec
      pg_operator.oprisleft
      pg_proc.proimplicit
      pg_proc.probyte_pct
      pg_proc.properbyte_cpu
      pg_proc.propercall_cpu
      pg_proc.prooutin_ratio
      pg_shadow.usetrace
      pg_type.typprtlen
      pg_type.typreceive
      pg_type.typsend
      
      Attempts to use the obsoleted attributes of pg_operator or pg_proc
      in the CREATE commands will be greeted by a warning.  For pg_type,
      there is no warning (yet) because pg_dump scripts still contain these
      attributes.
      
      Also remove new but already obsolete spellings
      isVolatile, isStable, isImmutable in WITH clause.  (Use new syntax
      instead.)
      739adf32
  19. 19 7月, 2002 1 次提交
  20. 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
  21. 17 7月, 2002 1 次提交
  22. 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
  23. 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
  24. 01 7月, 2002 1 次提交
    • T
      First phase of applying Rod Taylor's pg_depend patch. This just adds · 131f801d
      Tom Lane 提交于
      RESTRICT/CASCADE syntax to the DROP commands that need it, and propagates
      the behavioral option through the parser to the routines that execute
      drops.  Doesn't do anything useful yet, but I figured I'd commit these
      changes so I could get out of the parser area while working on the rest.
      131f801d
  25. 21 6月, 2002 2 次提交
  26. 19 6月, 2002 1 次提交
  27. 23 5月, 2002 1 次提交
    • P
      Add optional "validator" function to languages that can validate the · d60f10b0
      Peter Eisentraut 提交于
      function body (and other properties) as a function in the language
      is created.  This generalizes ad hoc code that already existed for
      the built-in languages.
      
      The validation now happens after the pg_proc tuple of the new function
      is created, so it is possible to define recursive SQL functions.
      
      Add some regression test cases that cover bogus function definition
      attempts.
      d60f10b0
  28. 18 5月, 2002 1 次提交
  29. 17 5月, 2002 1 次提交
    • T
      Merge the last few variable.c configuration variables into the generic · f0811a74
      Tom Lane 提交于
      GUC support.  It's now possible to set datestyle, timezone, and
      client_encoding from postgresql.conf and per-database or per-user
      settings.  Also, implement rollback of SET commands that occur in a
      transaction that later fails.  Create a SET LOCAL var = value syntax
      that sets the variable only for the duration of the current transaction.
      All per previous discussions in pghackers.
      f0811a74
  30. 14 5月, 2002 1 次提交
  31. 13 5月, 2002 2 次提交