1. 11 Jul, 2006 1 commit
  2. 02 May, 2006 1 commit
  3. 26 Jan, 2006 1 commit
    • Tom Lane's avatar
      Clean up the INET-vs-CIDR situation. Get rid of the internal is_cidr flag · 8d8bf127
      Tom Lane authored
      and rely exclusively on the SQL type system to tell the difference between
      the types.  Prevent creation of invalid CIDR values via casting from INET
      or set_masklen() --- both of these operations now silently zero any bits
      to the right of the netmask.  Remove duplicate CIDR comparison operators,
      letting the type rely on the INET operators instead.
      8d8bf127
  4. 07 Nov, 2005 1 commit
  5. 01 Jul, 2005 1 commit
  6. 24 Jun, 2005 1 commit
    • Tom Lane's avatar
      Extend r-tree operator classes to handle Y-direction tests equivalent · b90f8f20
      Tom Lane authored
      to the existing X-direction tests.  An rtree class now includes 4 actual
      2-D tests, 4 1-D X-direction tests, and 4 1-D Y-direction tests.
      This involved adding four new Y-direction test operators for each of
      box and polygon; I followed the PostGIS project's lead as to the names
      of these operators.
      NON BACKWARDS COMPATIBLE CHANGE: the poly_overleft (&<) and poly_overright
      (&>) operators now have semantics comparable to box_overleft and box_overright.
      This is necessary to make r-tree indexes work correctly on polygons.
      Also, I changed circle_left and circle_right to agree with box_left and
      box_right --- formerly they allowed the boundaries to touch.  This isn't
      actually essential given the lack of any r-tree opclass for circles, but
      it seems best to sync all the definitions while we are at it.
      b90f8f20
  7. 12 Apr, 2005 1 commit
    • Tom Lane's avatar
      Add aggsortop column to pg_aggregate, so that MIN/MAX optimization can · 2e7a6889
      Tom Lane authored
      be supported for all datatypes.  Add CREATE AGGREGATE and pg_dump support
      too.  Add specialized min/max aggregates for bpchar, instead of depending
      on text's min/max, because otherwise the possible use of bpchar indexes
      cannot be recognized.
      initdb forced because of catalog changes.
      2e7a6889
  8. 29 Mar, 2005 1 commit
    • Tom Lane's avatar
      Convert oidvector and int2vector into variable-length arrays. This · 70c9763d
      Tom Lane authored
      change saves a great deal of space in pg_proc and its primary index,
      and it eliminates the former requirement that INDEX_MAX_KEYS and
      FUNC_MAX_ARGS have the same value.  INDEX_MAX_KEYS is still embedded
      in the on-disk representation (because it affects index tuple header
      size), but FUNC_MAX_ARGS is not.  I believe it would now be possible
      to increase FUNC_MAX_ARGS at little cost, but haven't experimented yet.
      There are still a lot of vestigial references to FUNC_MAX_ARGS, which
      I will clean up in a separate pass.  However, getting rid of it
      altogether would require changing the FunctionCallInfoData struct,
      and I'm not sure I want to buy into that.
      70c9763d
  9. 04 Aug, 2004 1 commit
  10. 16 Jun, 2004 1 commit
    • Tom Lane's avatar
      Represent type-specific length coercion functions as pg_cast entries, · d70a42e6
      Tom Lane authored
      eliminating the former hard-wired convention about their names.  Allow
      pg_cast entries to represent both type coercion and length coercion in
      a single step --- this is represented by a function that takes an
      extra typmod argument, just like a length coercion function.  This
      nicely merges the type and length coercion mechanisms into something
      at least a little cleaner than we had before.  Make use of the single-
      coercion-step behavior to fix integer-to-bit coercion so that coercing
      to bit(n) yields the rightmost n bits of the integer instead of the
      leftmost n bits.  This should fix recurrent complaints about the odd
      behavior of this coercion.  Clean up the documentation of the bit string
      functions, and try to put it where people might actually find it.
      Also, get rid of the unreliable heuristics in ruleutils.c about whether
      to display nested coercion steps; instead require parse_coerce.c to
      label them properly in the first place.
      d70a42e6
  11. 13 Jun, 2004 1 commit
  12. 22 Mar, 2004 1 commit
  13. 15 Mar, 2004 1 commit
    • Tom Lane's avatar
      Remove grotty special-case code in coerce_to_target_type() that · 89ab5c4a
      Tom Lane authored
      implemented casts to varchar and bpchar using a cast-to-text function.
      This is a holdover from before we had pg_cast; it now makes more sense
      to just list these casts in pg_cast.  While at it, add pg_cast entries
      for the other direction (casts from varchar/bpchar) where feasible.
      89ab5c4a
  14. 12 Nov, 2003 1 commit
    • Tom Lane's avatar
      Cross-data-type comparisons are now indexable by btrees, pursuant to my · fa5c8a05
      Tom Lane authored
      pghackers proposal of 8-Nov.  All the existing cross-type comparison
      operators (int2/int4/int8 and float4/float8) have appropriate support.
      The original proposal of storing the right-hand-side datatype as part of
      the primary key for pg_amop and pg_amproc got modified a bit in the event;
      it is easier to store zero as the 'default' case and only store a nonzero
      when the operator is actually cross-type.  Along the way, remove the
      long-since-defunct bigbox_ops operator class.
      fa5c8a05
  15. 22 Jun, 2003 1 commit
    • Tom Lane's avatar
      Revise hash join and hash aggregation code to use the same datatype- · bff0422b
      Tom Lane authored
      specific hash functions used by hash indexes, rather than the old
      not-datatype-aware ComputeHashFunc routine.  This makes it safe to do
      hash joining on several datatypes that previously couldn't use hashing.
      The sets of datatypes that are hash indexable and hash joinable are now
      exactly the same, whereas before each had some that weren't in the other.
      bff0422b
  16. 26 May, 2003 1 commit
    • Tom Lane's avatar
      Cause CHAR(n) to TEXT or VARCHAR conversion to automatically strip trailing · f45df8c0
      Tom Lane authored
      blanks, in hopes of reducing the surprise factor for newbies.  Remove
      redundant operators for VARCHAR (it depends wholly on TEXT operations now).
      Clean up resolution of ambiguous operators/functions to avoid surprising
      choices for domains: domains are treated as equivalent to their base types
      and binary-coercibility is no longer considered a preference item when
      choosing among multiple operators/functions.  IsBinaryCoercible now correctly
      reflects the notion that you need *only* relabel the type to get from type
      A to type B: that is, a domain is binary-coercible to its base type, but
      not vice versa.  Various marginal cleanup, including merging the essentially
      duplicate resolution code in parse_func.c and parse_oper.c.  Improve opr_sanity
      regression test to understand about binary compatibility (using pg_cast),
      and fix a couple of small errors in the catalogs revealed thereby.
      Restructure "special operator" handling to fetch operators via index opclasses
      rather than hardwiring assumptions about names (cleans up the pattern_ops
      stuff a little).
      f45df8c0
  17. 15 May, 2003 1 commit
  18. 08 Apr, 2003 1 commit
  19. 28 Jan, 2003 1 commit
  20. 15 Jan, 2003 1 commit
    • Tom Lane's avatar
      Allow merge and hash joins to occur on arbitrary expressions (anything not · de97072e
      Tom Lane authored
      containing a volatile function), rather than only on 'Var = Var' clauses
      as before.  This makes it practical to do flatten_join_alias_vars at the
      start of planning, which in turn eliminates a bunch of klugery inside the
      planner to deal with alias vars.  As a free side effect, we now detect
      implied equality of non-Var expressions; for example in
      	SELECT ... WHERE a.x = b.y and b.y = 42
      we will deduce a.x = 42 and use that as a restriction qual on a.  Also,
      we can remove the restriction introduced 12/5/02 to prevent pullup of
      subqueries whose targetlists contain sublinks.
      Still TODO: make statistical estimation routines in selfuncs.c and costsize.c
      smarter about expressions that are more complex than plain Vars.  The need
      for this is considerably greater now that we have to be able to estimate
      the suitability of merge and hash join techniques on such expressions.
      de97072e
  21. 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
  22. 05 Sep, 2002 1 commit
  23. 23 Aug, 2002 1 commit
  24. 22 Aug, 2002 1 commit
  25. 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
  26. 18 May, 2002 1 commit
  27. 25 Apr, 2002 1 commit
  28. 11 Apr, 2002 1 commit
    • Tom Lane's avatar
      Restructure representation of aggregate functions so that they have pg_proc · 902a6a0a
      Tom Lane authored
      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
  29. 05 Apr, 2002 1 commit
  30. 04 Apr, 2002 1 commit
    • Bruce Momjian's avatar
      Authentication improvements: · 43a3543a
      Bruce Momjian authored
      A new pg_hba.conf column, USER
      Allow specifiction of lists of users separated by commas
      Allow group names specified by +
      Allow include files containing lists of users specified by @
      Allow lists of databases, and database files
      Allow samegroup in database column to match group name matching dbname
      Removal of secondary password files
      Remove pg_passwd utility
      Lots of code cleanup in user.c and hba.c
      New data/global/pg_pwd format
      New data/global/pg_group file
      43a3543a
  31. 30 Sep, 2001 1 commit
  32. 28 Sep, 2001 1 commit
  33. 21 Aug, 2001 1 commit
    • Tom Lane's avatar
      Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions in · f933766b
      Tom Lane authored
      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
  34. 14 Aug, 2001 1 commit
    • Tom Lane's avatar
      sum() on int2 and int4 columns now uses an int8, not numeric, accumulator · 5f7c2bdb
      Tom Lane authored
      for speed reasons; its result type also changes to int8.  avg() on these
      datatypes now accumulates the running sum in int8 for speed; but we still
      deliver the final result as numeric, so that fractional accuracy is
      preserved.
      
      count() now counts and returns in int8, not int4.  I am a little nervous
      about this possibly breaking users' code, but there didn't seem to be
      a strong sentiment for avoiding the problem.  If we get complaints during
      beta, we can change count back to int4 and add a "count8" aggregate.
      For that matter, users can do it for themselves with a simple CREATE
      AGGREGATE command; the int4inc function is still present, so no C hacking
      is needed.
      
      Also added max() and min() aggregates for OID that do proper unsigned
      comparison, instead of piggybacking on int4 aggregates.
      
      initdb forced.
      5f7c2bdb
  35. 10 Aug, 2001 1 commit
    • Tom Lane's avatar
      Make OIDs optional, per discussions in pghackers. WITH OIDS is still the · bf56f075
      Tom Lane authored
      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
  36. 15 Jul, 2001 1 commit
    • Tom Lane's avatar
      Restructure index AM interface for index building and index tuple deletion, · c8076f09
      Tom Lane authored
      per previous discussion on pghackers.  Most of the duplicate code in
      different AMs' ambuild routines has been moved out to a common routine
      in index.c; this means that all index types now do the right things about
      inserting recently-dead tuples, etc.  (I also removed support for EXTEND
      INDEX in the ambuild routines, since that's about to go away anyway, and
      it cluttered the code a lot.)  The retail indextuple deletion routines have
      been replaced by a "bulk delete" routine in which the indexscan is inside
      the access method.  I haven't pushed this change as far as it should go yet,
      but it should allow considerable simplification of the internal bookkeeping
      for deletions.  Also, add flag columns to pg_am to eliminate various
      hardcoded tests on AM OIDs, and remove unused pg_am columns.
      
      Fix rtree and gist index types to not attempt to store NULLs; before this,
      gist usually crashed, while rtree managed not to crash but computed wacko
      bounding boxes for NULL entries (which might have had something to do with
      the performance problems we've heard about occasionally).
      
      Add AtEOXact routines to hash, rtree, and gist, all of which have static
      state that needs to be reset after an error.  We discovered this need long
      ago for btree, but missed the other guys.
      
      Oh, one more thing: concurrent VACUUM is now the default.
      c8076f09
  37. 12 Jun, 2001 1 commit
    • Tom Lane's avatar
      Clean up various to-do items associated with system indexes: · 1d584f97
      Tom Lane authored
      pg_database now has unique indexes on oid and on datname.
      pg_shadow now has unique indexes on usename and on usesysid.
      pg_am now has unique index on oid.
      pg_opclass now has unique index on oid.
      pg_amproc now has unique index on amid+amopclaid+amprocnum.
      Remove pg_rewrite's unnecessary index on oid, delete unused RULEOID syscache.
      Remove index on pg_listener and associated syscache for performance reasons
      (caching rows that are certain to change before you need 'em again is
      rather pointless).
      Change pg_attrdef's nonunique index on adrelid into a unique index on
      adrelid+adnum.
      
      Fix various incorrect settings of pg_class.relisshared, make that the
      primary reference point for whether a relation is shared or not.
      IsSharedSystemRelationName() is now only consulted to initialize relisshared
      during initial creation of tables and indexes.  In theory we might now
      support shared user relations, though it's not clear how one would get
      entries for them into pg_class &etc of multiple databases.
      
      Fix recently reported bug that pg_attribute rows created for an index all have
      the same OID.  (Proof that non-unique OID doesn't matter unless it's
      actually used to do lookups ;-))
      
      There's no need to treat pg_trigger, pg_attrdef, pg_relcheck as bootstrap
      relations.  Convert them into plain system catalogs without hardwired
      entries in pg_class and friends.
      
      Unify global.bki and template1.bki into a single init script postgres.bki,
      since the alleged distinction between them was misleading and pointless.
      Not to mention that it didn't work for setting up indexes on shared
      system relations.
      
      Rationalize locking of pg_shadow, pg_group, pg_attrdef (no need to use
      AccessExclusiveLock where ExclusiveLock or even RowExclusiveLock will do).
      Also, hold locks until transaction commit where necessary.
      1d584f97
  38. 20 May, 2001 1 commit
    • Tom Lane's avatar
      Modify optimizer data structures so that IndexOptInfo lists built for · be03eb25
      Tom Lane authored
      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
  39. 15 May, 2001 1 commit
  40. 14 May, 2001 1 commit