1. 06 Jun, 2001 1 commit
  2. 02 Jun, 2001 1 commit
    • Tom Lane's avatar
      Tweak sorting so that nulls appear at the front of a descending sort · 5433b483
      Tom Lane authored
      (vs. at the end of a normal sort).  This ensures that explicit sorts
      yield the same ordering as a btree index scan.  To be really sure that
      that equivalence holds, we use the btree entries in pg_amop to decide
      whether we are looking at a '<' or '>' operator.  For a sort operator
      that has no btree association, we put the nulls at the front if the
      operator is named '>' ... pretty grotty, but it does the right thing in
      simple ASC and DESC cases, and at least there's no possibility of getting
      a different answer depending on the plan type chosen.
      5433b483
  3. 07 May, 2001 1 commit
    • Tom Lane's avatar
      Rewrite of planner statistics-gathering code. ANALYZE is now available as · f905d65e
      Tom Lane authored
      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
  4. 22 Mar, 2001 2 commits
  5. 16 Feb, 2001 1 commit
    • Tom Lane's avatar
      Clean up two rather nasty bugs in operator selection code. · 13cc7eb3
      Tom Lane authored
      1. If there is exactly one pg_operator entry of the right name and oprkind,
      oper() and related routines would return that entry whether its input type
      had anything to do with the request or not.  This is just premature
      optimization: we shouldn't return the single candidate until after we verify
      that it really is a valid candidate, ie, is at least coercion-compatible
      with the given types.
      
      2. oper() and related routines only promise a coercion-compatible result.
      Unfortunately, there were quite a few callers that assumed the returned
      operator is binary-compatible with the given datatype; they would proceed
      to call it without making any datatype coercions.  These callers include
      sorting, grouping, aggregation, and VACUUM ANALYZE.  In general I think
      it is appropriate for these callers to require an exact or binary-compatible
      match, so I've added a new routine compatible_oper() that only succeeds if
      it can find an operator that doesn't require any run-time conversions.
      Callers now call oper() or compatible_oper() depending on whether they are
      prepared to deal with type conversion or not.
      
      The upshot of these bugs is revealed by the following silliness in PL/Tcl's
      selftest: it creates an operator @< on int4, and then tries to use it to
      sort a char(N) column.  The system would let it do that :-( (and evidently
      has done so since 6.3 :-( :-().  The result in this case was just a silly
      sort order, but the reverse combination would've provoked coredump from
      trying to dereference integers.  With this fix you get more reasonable
      behavior:
      pltcl_test=# select * from T_pkey1 order by key1, key2 using @<;
      ERROR:  Unable to identify an operator '@<' for types 'bpchar' and 'bpchar'
              You will have to retype this query using an explicit cast
      13cc7eb3
  6. 24 Jan, 2001 1 commit
  7. 23 Jan, 2001 1 commit
    • Tom Lane's avatar
      Fix all the places that called heap_update() and heap_delete() without · 786f1a59
      Tom Lane authored
      bothering to check the return value --- which meant that in case the
      update or delete failed because of a concurrent update, you'd not find
      out about it, except by observing later that the transaction produced
      the wrong outcome.  There are now subroutines simple_heap_update and
      simple_heap_delete that should be used anyplace that you're not prepared
      to do the full nine yards of coping with concurrent updates.  In
      practice, that seems to mean absolutely everywhere but the executor,
      because *noplace* else was checking.
      786f1a59
  8. 14 Jan, 2001 1 commit
  9. 02 Dec, 2000 1 commit
  10. 16 Nov, 2000 1 commit
  11. 16 Oct, 2000 1 commit
  12. 05 Oct, 2000 1 commit
  13. 06 Sep, 2000 1 commit
    • Peter Eisentraut's avatar
      Code cleanup of user name and user id handling in the backend. The current · 6dc24961
      Peter Eisentraut authored
      user is now defined in terms of the user id, the user name is only computed
      upon request (for display purposes). This is kind of the opposite of the
      previous state, which would maintain the user name and compute the user id
      for permission checks.
      
      Besides perhaps saving a few cycles (integer vs string), this now creates a
      single point of attack for changing the user id during a connection, for
      purposes of "setuid" functions, etc.
      6dc24961
  14. 21 Aug, 2000 1 commit
    • Tom Lane's avatar
      fmgr interface mopup work. Use new DatumGetBool and BoolGetDatum · e67ff6b6
      Tom Lane authored
      macros where appropriate (the code used to have several different ways
      of doing that, including Int32, Int8, UInt8, ...).  Remove last few
      references to float32 and float64 typedefs --- it's all float4/float8
      now.  The typedefs themselves should probably stay in c.h for a release
      or two, though, to avoid breaking user-written C functions.
      e67ff6b6
  15. 06 Aug, 2000 1 commit
    • Tom Lane's avatar
      Toast all the system-table columns that seem to need it. It turns out · c3e2a951
      Tom Lane authored
      that giving pg_proc a toast table required solving the same problems
      we'd have to solve for pg_class --- pg_proc is one of the relations
      that gets bootstrapped in relcache.c.  Solution is to go back at the
      end of initialization and read in the *real* pg_class row to replace
      the phony entry created by formrdesc().  This should work as long as
      there's no need to touch any toasted values during initialization,
      which seems a reasonable assumption.
      Although I did not add a toast-table for every single system table
      with a varlena attribute, I believe that it would work to just do
      ALTER TABLE pg_class CREATE TOAST TABLE.  So anyone who's really
      intent on having several thousand ACL entries for a rel could do it.
      NOTE: I didn't force initdb, but you must do one to see the effects
      of this patch.
      c3e2a951
  16. 05 Jul, 2000 1 commit
  17. 30 May, 2000 1 commit
  18. 29 May, 2000 1 commit