1. 01 9月, 2002 1 次提交
    • T
      Mark the float8 -> int8 cast as implicit. This resolves the problem · 3c49c4b1
      Tom Lane 提交于
      pointed out by Barry Lind: UPDATE bigintcol = 10000000000 fails because
      the constant is initially taken as float8.  We really need a better way,
      but it's not gonna happen for 7.3.
      
      Also, remove int4reltime() function, which is redundant with the
      existing binary-compatibility coercion path from int4 to reltime,
      and probably has been unreachable code for a long while.
      3c49c4b1
  2. 27 8月, 2002 2 次提交
    • B
      This patch updates the lock listing code to use Joe Conway's new · a77d34f0
      Bruce Momjian 提交于
      anonymous return type SRF code. It gets rid of the superflous
      'pg_locks_result' that Bruce/Tom had commented on. Otherwise, no
      changes in functionality.
      
      Neil Conway
      a77d34f0
    • 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
  3. 24 8月, 2002 1 次提交
  4. 22 8月, 2002 4 次提交
  5. 21 8月, 2002 1 次提交
  6. 20 8月, 2002 2 次提交
    • B
      Allow pg_statistics to be reset by calling pg_stat_reset(). · 5243f9a9
      Bruce Momjian 提交于
      Christopher Kings-Lynne
      5243f9a9
    • B
      · de9801fc
      Bruce Momjian 提交于
      Add current_database().
      
      > Quick system function to pull out the current database.
      >
      > I've used this a number of times to allow stored procedures to find out
      > where they are.  Especially useful for those that do logging or hit a
      > remote server.
      >
      > It's called current_database() to match with current_user().
      
      It's also a necessity for an informational schema.  The catalog
      (database) name is required in a number of places.
      
      Rod Taylor
      de9801fc
  7. 17 8月, 2002 2 次提交
    • B
      [ Newest version of patch applied.] · 82119a69
      Bruce Momjian 提交于
      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
    • T
      Modify pg_dump to dump foreign-key constraints as constraints, not as · a208ea72
      Tom Lane 提交于
      sets of triggers.  Also modify psql \d command to show foreign key
      constraints as such and hide the triggers.  pg_get_constraintdef()
      function added to backend to support these.  From Rod Taylor, code
      review and some editorialization by Tom Lane.
      a208ea72
  8. 15 8月, 2002 1 次提交
    • B
      As discussed on several occasions previously, the new anonymous · 45e25445
      Bruce Momjian 提交于
      composite type capability makes it possible to create a system view
      based on a table function in a way that is hopefully palatable to
      everyone. The attached patch takes advantage of this, moving
      show_all_settings() from contrib/tablefunc into the backend (renamed
      all_settings(). It is defined as a builtin returning type RECORD. During
      initdb a system view is created to expose the same information presently
      available through SHOW ALL. For example:
      
      test=# select * from pg_settings where name like '%debug%';
                name          | setting
      -----------------------+---------
        debug_assertions      | on
        debug_pretty_print    | off
        debug_print_parse     | off
        debug_print_plan      | off
        debug_print_query     | off
        debug_print_rewritten | off
        wal_debug             | 0
      (7 rows)
      
      
      Additionally during initdb two rules are created which make it possible
      to change settings by updating the system view -- a "virtual table" as
      Tom put it. Here's an example:
      
      Joe Conway
      45e25445
  9. 10 8月, 2002 1 次提交
    • T
      has_table_privilege spawns scions has_database_privilege, has_function_privilege, · 4ab8e690
      Tom Lane 提交于
      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
  10. 06 8月, 2002 1 次提交
  11. 05 8月, 2002 2 次提交
  12. 04 8月, 2002 1 次提交
  13. 31 7月, 2002 2 次提交
  14. 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
  15. 20 7月, 2002 1 次提交
  16. 19 7月, 2002 1 次提交
    • P
      pg_cast table, and standards-compliant CREATE/DROP CAST commands, plus · 97377048
      Peter Eisentraut 提交于
      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
  17. 21 6月, 2002 1 次提交
  18. 16 6月, 2002 1 次提交
  19. 11 6月, 2002 1 次提交
    • T
      Implement SQL99 OVERLAY(). Allows substitution of a substring in a string. · ea01a451
      Thomas G. Lockhart 提交于
      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
  20. 25 5月, 2002 1 次提交
    • T
      Mark index entries "killed" when they are no longer visible to any · 3f4d4880
      Tom Lane 提交于
      transaction, so as to avoid returning them out of the index AM.  Saves
      repeated heap_fetch operations on frequently-updated rows.  Also detect
      queries on unique keys (equality to all columns of a unique index), and
      don't bother continuing scan once we have found first match.
      
      Killing is implemented in the btree and hash AMs, but not yet in rtree
      or gist, because there isn't an equally convenient place to do it in
      those AMs (the outer amgetnext routine can't do it without re-pinning
      the index page).
      
      Did some small cleanup on APIs of HeapTupleSatisfies, heap_fetch, and
      index_insert to make this a little easier.
      3f4d4880
  21. 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
  22. 21 5月, 2002 1 次提交
    • T
      Restructure indexscan API (index_beginscan, index_getnext) per · 44fbe20d
      Tom Lane 提交于
      yesterday's proposal to pghackers.  Also remove unnecessary parameters
      to heap_beginscan, heap_rescan.  I modified pg_proc.h to reflect the
      new numbers of parameters for the AM interface routines, but did not
      force an initdb because nothing actually looks at those fields.
      44fbe20d
  23. 18 5月, 2002 1 次提交
  24. 03 5月, 2002 1 次提交
    • T
      Retire xlateSqlType/xlateSqlFunc; all type name translations are now · 53cedcac
      Tom Lane 提交于
      handled as special productions.  This is needed to keep us honest about
      user-schema type names that happen to coincide with system type names.
      Per pghackers discussion 24-Apr.  To avoid bloating the keyword list
      too much, I removed the translations for datetime, timespan, and lztext,
      all of which were slated for destruction several versions back anyway.
      53cedcac
  25. 01 5月, 2002 1 次提交
  26. 26 4月, 2002 1 次提交
  27. 25 4月, 2002 1 次提交
  28. 24 4月, 2002 3 次提交
  29. 22 4月, 2002 1 次提交
    • T
      Support alternate storage scheme of 64-bit integer for date/time types. · 547df0cc
      Thomas G. Lockhart 提交于
       Use "--enable-integer-datetimes" in configuration to use this rather
       than the original float8 storage. I would recommend the integer-based
       storage for any platform on which it is available. We perhaps should
       make this the default for the production release.
      Change timezone(timestamptz) results to return timestamp rather than
       a character string. Formerly, we didn't have a way to represent
       timestamps with an explicit time zone other than freezing the info into
       a string. Now, we can reasonably omit the explicit time zone from the
       result and return a timestamp with values appropriate for the specified
       time zone. Much cleaner, and if you need the time zone in the result
       you can put it into a character string pretty easily anyway.
      Allow fractional seconds in date/time types even for dates prior to 1BC.
      Limit timestamp data types to 6 decimal places of precision. Just right
       for a micro-second storage of int8 date/time types, and reduces the
       number of places ad-hoc rounding was occuring for the float8-based types.
      Use lookup tables for precision/rounding calculations for timestamp and
       interval types.  Formerly used pow() to calculate the desired value but
       with a more limited range there is no reason to not type in a lookup
       table. Should be *much* better performance, though formerly there were
       some optimizations to help minimize the number of times pow() was called.
      Define a HAVE_INT64_TIMESTAMP variable. Based on the configure option
       "--enable-integer-datetimes" and the existing internal INT64_IS_BUSTED.
      Add explicit date/interval operators and functions for addition and
       subtraction. Formerly relied on implicit type promotion from date to
       timestamp with time zone.
      Change timezone conversion functions for the timetz type from "timetz()"
       to "timezone()". This is consistant with other time zone coersion
       functions for other types.
      Bump the catalog version to 200204201.
      Fix up regression tests to reflect changes in fractional seconds
       representation for date/times in BC eras.
      All regression tests pass on my Linux box.
      547df0cc
  30. 19 4月, 2002 1 次提交
    • T
      Rule names are now unique per-relation, rather than unique globally. · b3120804
      Tom Lane 提交于
      DROP RULE and COMMENT ON RULE syntax adds an 'ON tablename' clause,
      similar to TRIGGER syntaxes.  To allow loading of existing pg_dump
      files containing COMMENT ON RULE, the COMMENT code will still accept
      the old syntax --- but only if the target rulename is unique across
      the whole database.
      b3120804