1. 26 11月, 2005 2 次提交
    • T
      Change seqscan logic so that we check visibility of all tuples on a page · 70f1482d
      Tom Lane 提交于
      when we first read the page, rather than checking them one at a time.
      This allows us to take and release the buffer content lock just once
      per page, instead of once per tuple.  Since it's a shared lock the
      contention penalty for holding the lock longer shouldn't be too bad.
      We can safely do this only when using an MVCC snapshot; else the
      assumption that visibility won't change over time is uncool.  Therefore
      there are now two code paths depending on the snapshot type.  I also
      made the same change in nodeBitmapHeapscan.c, where it can be done always
      because we only support MVCC snapshots for bitmap scans anyway.
      Also make some incidental cleanups in the APIs of these functions.
      Per a suggestion from Qingqing Zhou.
      70f1482d
    • T
      Teach planner and executor to handle ScalarArrayOpExpr as an indexable · 290166f9
      Tom Lane 提交于
      qualification when the underlying operator is indexable and useOr is true.
      That is, indexkey op ANY (ARRAY[...]) is effectively translated into an
      OR combination of one indexscan for each array element.  This only works
      for bitmap index scans, of course, since regular indexscans no longer
      support OR'ing of scans.  There are still some loose ends to clean up
      before changing 'x IN (list)' to translate as a ScalarArrayOpExpr;
      for instance predtest.c ought to be taught about it.  But this gets the
      basic functionality in place.
      290166f9
  2. 23 11月, 2005 1 次提交
  3. 21 11月, 2005 1 次提交
    • A
      Implement DROP OWNED and REASSIGN OWNED. These new commands facilitate the · cec3b0a9
      Alvaro Herrera 提交于
      process of dropping roles by dropping objects owned by them and privileges
      granted to them, or giving the owned objects to someone else, through the
      use of the data stored in the new pg_shdepend catalog.
      
      Some refactoring of the GRANT/REVOKE code was needed, as well as ALTER OWNER
      code.  Further cleanup of code duplication in the GRANT code seems necessary.
      
      Implemented by me after an idea from Tom Lane, who also provided various kind
      of implementation advice.
      
      Regression tests pass.  Some tests for the new functionality are also added,
      as well as rudimentary documentation.
      cec3b0a9
  4. 18 11月, 2005 2 次提交
  5. 08 11月, 2005 1 次提交
  6. 05 11月, 2005 2 次提交
    • T
      Repair an error introduced by log_line_prefix patch: it is not acceptable · 48052de7
      Tom Lane 提交于
      to assume that the string pointer passed to set_ps_display is good forever.
      There's no need to anyway since ps_status.c itself saves the string, and
      we already had an API (get_ps_display) to return it.
      I believe this explains Jim Nasby's report of intermittent crashes in
      elog.c when %i format code is in use in log_line_prefix.
      While at it, repair a previously unnoticed problem: on some platforms such as
      Darwin, the string returned by get_ps_display was blank-padded to the maximum
      length, meaning that lock.c's attempt to append " waiting" to it never worked.
      48052de7
    • T
      Disregard superuserness when checking to see if a role GRANT would · c3d8de09
      Tom Lane 提交于
      create circularity of role memberships.  This is a minimum-impact fix
      for the problem reported by Florian Pflug.  I thought about removing
      the superuser_arg test from is_member_of_role() altogether, as it seems
      redundant for many of the callers --- but not all, and it's way too late
      in the 8.1 cycle to be making large changes.  Perhaps reconsider this
      later.
      c3d8de09
  7. 19 10月, 2005 2 次提交
  8. 15 10月, 2005 2 次提交
    • B
      Standard pgindent run for 8.1. · 1dc34982
      Bruce Momjian 提交于
      1dc34982
    • T
      Fix syslog bug: if any messages are emitted to write_syslog before · abd3f43b
      Tom Lane 提交于
      the facility has been set, the facility gets set to LOCAL0 and cannot
      be changed later.  This seems reasonably plausible to happen, particularly
      at higher debug log levels, though I am not certain it explains Han Holl's
      recent report.  Easiest fix is to teach the code how to change the value
      on-the-fly, which is nicer anyway.  I made the settings PGC_SIGHUP to
      conform with log_destination.
      abd3f43b
  9. 11 10月, 2005 1 次提交
  10. 10 10月, 2005 1 次提交
    • T
      Fix (hopefully for the last time) problems with datetime values displaying · 313ed1ed
      Tom Lane 提交于
      like '23:59:60' because of fractional-second roundoff problems.  Trying
      to control this upstream of the actual display code was hopeless; the right
      way is to explicitly round fractional seconds in the display code and then
      refigure the results if the fraction rounds up to 1.  Per bug #1927.
      313ed1ed
  11. 08 10月, 2005 1 次提交
  12. 06 10月, 2005 1 次提交
    • T
      Revise pgstats stuff to fix the problems with not counting accesses · cb8b6618
      Tom Lane 提交于
      generated by bitmap index scans.  Along the way, simplify and speed up
      the code for counting sequential and index scans; it was both confusing
      and inefficient to be taking care of that in the per-tuple loops, IMHO.
      initdb forced because of internal changes in pg_stat view definitions.
      cb8b6618
  13. 04 10月, 2005 1 次提交
  14. 03 10月, 2005 1 次提交
    • T
      Change nextval and other sequence functions to specify their sequence · aa731ed8
      Tom Lane 提交于
      argument as a 'regclass' value instead of a text string.  The frontend
      conversion of text string to pg_class OID is now encapsulated as an
      implicitly-invocable coercion from text to regclass.  This provides
      backwards compatibility to the old behavior when the sequence argument
      is explicitly typed as 'text'.  When the argument is just an unadorned
      literal string, it will be taken as 'regclass', which means that the
      stored representation will be an OID.  This solves longstanding problems
      with renaming sequences that are referenced in default expressions, as
      well as new-in-8.1 problems with renaming such sequences' schemas or
      moving them to another schema.  All per recent discussion.
      Along the way, fix some rather serious problems in dbmirror's support
      for mirroring sequence operations (int4 vs int8 confusion for instance).
      aa731ed8
  15. 16 9月, 2005 1 次提交
    • N
      Rename pg_complete_relation_size() to pg_total_relation_size(), for the · e4d9b697
      Neil Conway 提交于
      sake of brevity and clarity.
      
      Make pg_reload_conf(), pg_rotate_logfile(), and pg_cancel_backend()
      return a boolean rather than an integer to indicate success or failure.
      
      Along the way, make some minor cleanups to dbsize.c -- in particular,
      use elog() rather than ereport() for "shouldn't happen" error
      conditions, and remove some of the more flagrant violations of the
      Postgres indentation conventions.
      
      Catalog version bumped.
      e4d9b697
  16. 21 8月, 2005 1 次提交
    • T
      Convert the arithmetic for shared memory size calculation from 'int' · 0007490e
      Tom Lane 提交于
      to 'Size' (that is, size_t), and install overflow detection checks in it.
      This allows us to remove the former arbitrary restrictions on NBuffers
      etc.  It won't make any difference in a 32-bit machine, but in a 64-bit
      machine you could theoretically have terabytes of shared buffers.
      (How efficiently we could manage 'em remains to be seen.)  Similarly,
      num_temp_buffers, work_mem, and maintenance_work_mem can be set above
      2Gb on a 64-bit machine.  Original patch from Koichi Suzuki, additional
      work by moi.
      0007490e
  17. 20 8月, 2005 1 次提交
    • T
      Repair problems with VACUUM destroying t_ctid chains too soon, and with · f57e3f4c
      Tom Lane 提交于
      insufficient paranoia in code that follows t_ctid links.  (We must do both
      because even with VACUUM doing it properly, the intermediate state with
      a dangling t_ctid link is visible concurrently during lazy VACUUM, and
      could be seen afterwards if either type of VACUUM crashes partway through.)
      Also try to improve documentation about what's going on.  Patch is a bit
      bulky because passing the XMAX information around required changing the
      APIs of some low-level heapam.c routines, but it's not conceptually very
      complicated.  Per trouble report from Teodor and subsequent analysis.
      This needs to be back-patched, but I'll do that after 8.1 beta is out.
      f57e3f4c
  18. 14 8月, 2005 1 次提交
    • T
      Tweak catalog cache management algorithms to reduce cost of · f60d176a
      Tom Lane 提交于
      SearchCatCacheList and ReleaseCatCacheList.  Previously, we incremented
      and decremented the refcounts of list member tuples along with the list
      itself, but that's unnecessary, and very expensive when the list is big.
      It's cheaper to change only the list refcount.  When we are considering
      deleting a cache entry, we have to check not only its own refcount but
      its parent list's ... but it's easy to arrange the code so that this
      check is not made in any commonly-used paths, so the cost is really nil.
      The bigger gain though is to refrain from DLMoveToFront'ing each individual
      member tuple each time the list is referenced.  To keep some semblance
      of fair space management, lists are just marked as used or not since the
      last cache cleanout search, and we do a MoveToFront pass only when about
      to run a cleanout.  In combination, these changes reduce the costs of
      SearchCatCacheList and ReleaseCatCacheList from about 4.5% of pgbench
      runtime to under 1%, according to my gprof results.
      f60d176a
  19. 13 8月, 2005 1 次提交
  20. 12 8月, 2005 2 次提交
  21. 30 7月, 2005 1 次提交
  22. 29 7月, 2005 1 次提交
  23. 27 7月, 2005 1 次提交
    • T
      Add a role property 'rolinherit' which, when false, denotes that the role · af019fb9
      Tom Lane 提交于
      doesn't automatically inherit the privileges of roles it is a member of;
      for such a role, membership in another role can be exploited only by doing
      explicit SET ROLE.  The default inherit setting is TRUE, so by default
      the behavior doesn't change, but creating a user with NOINHERIT gives closer
      adherence to our current reading of SQL99.  Documentation still lacking,
      and I think the information schema needs another look.
      af019fb9
  24. 26 7月, 2005 1 次提交
  25. 23 7月, 2005 1 次提交
  26. 22 7月, 2005 4 次提交
  27. 21 7月, 2005 4 次提交
  28. 15 7月, 2005 1 次提交
    • T
      Adjust permissions checking for ALTER OWNER commands: instead of · aa111062
      Tom Lane 提交于
      requiring superuserness always, allow an owner to reassign ownership
      to any role he is a member of, if that role would have the right to
      create a similar object.  These three requirements essentially state
      that the would-be alterer has enough privilege to DROP the existing
      object and then re-CREATE it as the new role; so we might as well
      let him do it in one step.  The ALTER TABLESPACE case is a bit
      squirrely, but the whole concept of non-superuser tablespace owners
      is pretty dubious anyway.  Stephen Frost, code review by Tom Lane.
      aa111062