1. 12 Dec, 2002 1 commit
    • Tom Lane's avatar
      Phase 2 of read-only-plans project: restructure expression-tree nodes · a0bf885f
      Tom Lane authored
      so that all executable expression nodes inherit from a common supertype
      Expr.  This is somewhat of an exercise in code purity rather than any
      real functional advance, but getting rid of the extra Oper or Func node
      formerly used in each operator or function call should provide at least
      a little space and speed improvement.
      initdb forced by changes in stored-rules representation.
      a0bf885f
  2. 06 Dec, 2002 1 commit
  3. 04 Dec, 2002 1 commit
  4. 25 Nov, 2002 1 commit
    • Tom Lane's avatar
      Restructure outfuncs and readfuncs to use macros in the same style as · dbe100c4
      Tom Lane authored
      just done for copyfuncs/equalfuncs.  Read functions in particular get
      a lot shorter than before, and it's much easier to compare an out function
      with the corresponding read function to make sure they agree.
      initdb forced due to small changes in nodestring format (regularizing
      a few cases that were formerly idiosyncratic).
      dbe100c4
  5. 23 Nov, 2002 1 commit
  6. 08 Nov, 2002 1 commit
    • Bruce Momjian's avatar
      The "Allow easy display of usernames in a group (pg_hba.conf uses groups · fef731d1
      Bruce Momjian authored
      now)" item on the open items, and subsequent plpgsql function I sent in,
      made me realize it was too hard to get the upper and lower bound of an
      array. The attached creates two functions that I think will be very
      useful when combined with the ability of plpgsql to return sets.
      
      array_lower(array, dim_num)
      - and -
      array_upper(array, dim_num)
      
      They return the value (as an int) of the upper and lower bound of the
      requested dim in the provided array.
      
      Joe Conway
      fef731d1
  7. 02 Nov, 2002 1 commit
  8. 19 Oct, 2002 1 commit
  9. 14 Oct, 2002 1 commit
  10. 22 Sep, 2002 1 commit
  11. 18 Sep, 2002 1 commit
    • Tom Lane's avatar
      Extend pg_cast castimplicit column to a three-way value; this allows us · b26dfb95
      Tom Lane authored
      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
  12. 02 Sep, 2002 2 commits
  13. 31 Aug, 2002 1 commit
    • Tom Lane's avatar
      Code review for pg_locks feature. Make shmemoffset of PROCLOCK structs · 1bab464e
      Tom Lane authored
      available (else there's no way to interpret the list links).  Change
      pg_locks view to show transaction ID locks separately from ordinary
      relation locks.  Avoid showing N duplicate rows when the same lock is
      held multiple times (seems unlikely that users care about exact hold
      count).  Improve documentation.
      1bab464e
  14. 30 Aug, 2002 1 commit
  15. 27 Aug, 2002 1 commit
  16. 26 Aug, 2002 1 commit
    • Tom Lane's avatar
      Modify array operations to include array's element type OID in the · 5cabcfcc
      Tom Lane authored
      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
  17. 24 Aug, 2002 1 commit
    • Tom Lane's avatar
      The cstring datatype can now be copied, passed around, etc. The typlen · 976246cc
      Tom Lane authored
      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
  18. 22 Aug, 2002 1 commit
  19. 17 Aug, 2002 1 commit
    • Bruce Momjian's avatar
      [ Newest version of patch applied.] · 82119a69
      Bruce Momjian authored
      This patch is an updated version of the lock listing patch. I've made
      the following changes:
      
          - write documentation
          - wrap the SRF in a view called 'pg_locks': all user-level
            access should be done through this view
          - re-diff against latest CVS
      
      One thing I chose not to do is adapt the SRF to use the anonymous
      composite type code from Joe Conway. I'll probably do that eventually,
      but I'm not really convinced it's a significantly cleaner way to
      bootstrap SRF builtins than the method this patch uses (of course, it
      has other uses...)
      
      Neil Conway
      82119a69
  20. 16 Aug, 2002 1 commit
  21. 13 Aug, 2002 1 commit
  22. 09 Aug, 2002 1 commit
    • Tom Lane's avatar
      has_table_privilege spawns scions has_database_privilege, has_function_privilege, · 4ab8e690
      Tom Lane authored
      has_language_privilege, has_schema_privilege to let SQL queries test
      all the new privilege types in 7.3.  Also, add functions pg_table_is_visible,
      pg_type_is_visible, pg_function_is_visible, pg_operator_is_visible,
      pg_opclass_is_visible to test whether objects contained in schemas are
      visible in the current search path.  Do some minor cleanup to centralize
      accesses to pg_database, as well.
      4ab8e690
  23. 06 Aug, 2002 1 commit
  24. 04 Aug, 2002 1 commit
    • Bruce Momjian's avatar
      Attached are two patches to implement and document anonymous composite · 9218689b
      Bruce Momjian authored
      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
  25. 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
  26. 25 Jul, 2002 1 commit
  27. 24 Jul, 2002 1 commit
    • Peter Eisentraut's avatar
      Remove unused system table columns: · 739adf32
      Peter Eisentraut authored
      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
  28. 18 Jul, 2002 1 commit
    • Peter Eisentraut's avatar
      pg_cast table, and standards-compliant CREATE/DROP CAST commands, plus · 97377048
      Peter Eisentraut authored
      extension to create binary compatible casts.  Includes dependency tracking
      as well.
      
      pg_proc.proimplicit is now defunct, but will be removed in a separate
      commit.
      
      pg_dump provides a migration path from the previous scheme to declare
      casts.  Dumping binary compatible casts is currently impossible, though.
      97377048
  29. 15 Jul, 2002 1 commit
  30. 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
  31. 11 Jul, 2002 1 commit
    • Tatsuo Ishii's avatar
      Add new CREATE CONVERSION/DROP CONVERSION command. · fcc96256
      Tatsuo Ishii authored
      This is the first cut toward CREATE CONVERSION/DROP CONVERSION implementaion.
      The commands can now add/remove tuples to the new pg_conversion system
      catalog, but that's all. Still need work to make them actually working.
      Documentations, regression tests also need work.
      fcc96256
  32. 02 Jul, 2002 1 commit
  33. 20 Jun, 2002 1 commit
  34. 15 Jun, 2002 1 commit
  35. 11 Jun, 2002 1 commit
    • Thomas G. Lockhart's avatar
      Implement SQL99 OVERLAY(). Allows substitution of a substring in a string. · ea01a451
      Thomas G. Lockhart authored
      Implement SQL99 SIMILAR TO as a synonym for our existing operator "~".
      Implement SQL99 regular expression SUBSTRING(string FROM pat FOR escape).
       Extend the definition to make the FOR clause optional.
       Define textregexsubstr() to actually implement this feature.
      Update the regression test to include these new string features.
       All tests pass.
      Rename the regular expression support routines from "pg95_xxx" to "pg_xxx".
      Define CREATE CHARACTER SET in the parser per SQL99. No implementation yet.
      ea01a451
  36. 22 May, 2002 1 commit
    • Peter Eisentraut's avatar
      Add optional "validator" function to languages that can validate the · d60f10b0
      Peter Eisentraut authored
      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
  37. 18 May, 2002 1 commit
  38. 12 May, 2002 2 commits