1. 15 8月, 2001 1 次提交
    • T
      sum() on int2 and int4 columns now uses an int8, not numeric, accumulator · 5f7c2bdb
      Tom Lane 提交于
      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
  2. 11 8月, 2001 2 次提交
  3. 10 8月, 2001 2 次提交
  4. 07 8月, 2001 2 次提交
  5. 16 7月, 2001 3 次提交
    • T
      Partial indexes work again, courtesy of Martijn van Oosterhout. · f31dc0ad
      Tom Lane 提交于
      Note: I didn't force an initdb, figuring that one today was enough.
      However, there is a new function in pg_proc.h, and pg_dump won't be
      able to dump partial indexes until you add that function.
      f31dc0ad
    • T
      Restructure index AM interface for index building and index tuple deletion, · c8076f09
      Tom Lane 提交于
      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
    • T
      Add ORDER BY to a couple of test queries whose output ordering is not · 997439f5
      Tom Lane 提交于
      as predictable as it used to be, due to recycling of free space with
      new VACUUM.
      997439f5
  6. 10 7月, 2001 1 次提交
  7. 03 7月, 2001 1 次提交
  8. 23 6月, 2001 1 次提交
  9. 19 6月, 2001 1 次提交
  10. 17 6月, 2001 1 次提交
  11. 15 6月, 2001 1 次提交
  12. 14 6月, 2001 2 次提交
  13. 13 6月, 2001 1 次提交
  14. 12 6月, 2001 2 次提交
    • B
      OK -- here's take #5. · 58c909bb
      Bruce Momjian 提交于
      It "make"s and "make check"s clean against current cvs tip.
      
      There are now both Text and Name variants, and the regression test support
      is rolled into the patch. Note that to be complete wrt Name based variants,
      there are now 12 user visible versions of has_table_privilege:
      
      has_table_privilege(Text usename, Text relname, Text priv_type)
      has_table_privilege(Text usename, Name relname, Text priv_type)
      has_table_privilege(Name usename, Text relname, Text priv_type)
      has_table_privilege(Name usename, Name relname, Text priv_type)
      has_table_privilege(Text relname, Text priv_type) /* assumes current_user */
      has_table_privilege(Name relname, Text priv_type) /* assumes current_user */
      has_table_privilege(Text usename, Oid reloid, Text priv_type)
      has_table_privilege(Name usename, Oid reloid, Text priv_type)
      has_table_privilege(Oid reloid, Text priv_type)  /* assumes current_user */
      has_table_privilege(Oid usesysid, Text relname, Text priv_type)
      has_table_privilege(Oid usesysid, Name relname, Text priv_type)
      has_table_privilege(Oid usesysid, Oid reloid, Text priv_type)
      
      For the Text based inputs, a new internal function, get_Name is used
      (shamelessly copied from get_seq_name in sequence.c) to downcase if not
      quoted, or remove quotes if quoted, and truncate. I also added a few test
      cases for the downcasing, quote removal, and Name based variants to the
      regression test.
      
      Joe Conway
      58c909bb
    • T
      Clean up various to-do items associated with system indexes: · 1d584f97
      Tom Lane 提交于
      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
  15. 10 6月, 2001 1 次提交
  16. 05 6月, 2001 1 次提交
  17. 02 6月, 2001 1 次提交
    • T
      New improved version of bpcharin() may have got the truncation case · 7c0c9b3c
      Tom Lane 提交于
      right, but it failed to get the padding case right.
      
      This was obscured by subsequent application of bpchar() in all but one
      regression test case, and that one didn't fail in an obvious way ---
      trailing blanks are hard to see.  Add another test case to make it
      more obvious if it breaks again.
      7c0c9b3c
  18. 30 5月, 2001 1 次提交
  19. 27 5月, 2001 1 次提交
  20. 23 5月, 2001 1 次提交
  21. 22 5月, 2001 1 次提交
  22. 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
  23. 19 5月, 2001 1 次提交
  24. 15 5月, 2001 2 次提交
  25. 11 5月, 2001 2 次提交
  26. 10 5月, 2001 1 次提交
  27. 07 5月, 2001 1 次提交
    • T
      Rewrite of planner statistics-gathering code. ANALYZE is now available as · f905d65e
      Tom Lane 提交于
      a separate statement (though it can still be invoked as part of VACUUM, too).
      pg_statistic redesigned to be more flexible about what statistics are
      stored.  ANALYZE now collects a list of several of the most common values,
      not just one, plus a histogram (not just the min and max values).  Random
      sampling is used to make the process reasonably fast even on very large
      tables.  The number of values and histogram bins collected is now
      user-settable via an ALTER TABLE command.
      
      There is more still to do; the new stats are not being used everywhere
      they could be in the planner.  But the remaining changes for this project
      should be localized, and the behavior is already better than before.
      
      A not-very-related change is that sorting now makes use of btree comparison
      routines if it can find one, rather than invoking '<' twice.
      f905d65e
  28. 04 5月, 2001 1 次提交
    • T
      Ensure that btree sort ordering functions and boolean comparison operators · 2792374c
      Tom Lane 提交于
      give consistent results for all datatypes.  Types float4, float8, and
      numeric were broken for NaN values; abstime, timestamp, and interval
      were broken for INVALID values; timetz was just plain broken (some
      possible pairs of values were neither < nor = nor >).  Also clean up
      text, bpchar, varchar, and bit/varbit to eliminate duplicate code and
      thereby reduce the probability of similar inconsistencies arising in
      the future.
      2792374c
  29. 06 4月, 2001 1 次提交
  30. 05 4月, 2001 2 次提交