1. 04 2月, 2010 4 次提交
    • T
      Restructure CLUSTER/newstyle VACUUM FULL/ALTER TABLE support so that swapping · 9727c583
      Tom Lane 提交于
      of old and new toast tables can be done either at the logical level (by
      swapping the heaps' reltoastrelid links) or at the physical level (by swapping
      the relfilenodes of the toast tables and their indexes).  This is necessary
      infrastructure for upcoming changes to support CLUSTER/VAC FULL on shared
      system catalogs, where we cannot change reltoastrelid.  The physical swap
      saves a few catalog updates too.
      
      We unfortunately have to keep the logical-level swap logic because in some
      cases we will be adding or deleting a toast table, so there's no possibility
      of a physical swap.  However, that only happens as a consequence of schema
      changes in the table, which we do not need to support for system catalogs,
      so such cases aren't an obstacle for that.
      
      In passing, refactor the cluster support functions a little bit to eliminate
      unnecessarily-duplicated code; and fix the problem that while CLUSTER had
      been taught to rename the final toast table at need, ALTER TABLE had not.
      9727c583
    • J
      Check to ensure the number of primary key fields supplied does not · fdac8cf9
      Joe Conway 提交于
      exceed the total number of non-dropped source table fields for
      dblink_build_sql_*(). Addresses bug report from Rushabh Lathia.
      
      Backpatch all the way to the 7.3 branch.
      fdac8cf9
    • B
      73a835ee
    • B
  2. 03 2月, 2010 14 次提交
  3. 02 2月, 2010 1 次提交
    • R
      Tighten integrity checks on ALTER TABLE ... ALTER COLUMN ... RENAME. · 63f9282f
      Robert Haas 提交于
      When a column is renamed, we recursively rename the same column in
      all descendent tables.  But if one of those tables also inherits that
      column from a table outside the inheritance hierarchy rooted at the
      named table, we must throw an error.  The previous coding correctly
      prohibited the rename when the parent had inherited the column from
      elsewhere, but overlooked the case where the parent was OK but a child
      table also inherited the same column from a second, unrelated parent.
      
      For now, not backpatched due to lack of complaints from the field.
      
      KaiGai Kohei, with further changes by me.
      Reviewed by Bernd Helme and Tom Lane.
      63f9282f
  4. 01 2月, 2010 13 次提交
  5. 31 1月, 2010 2 次提交
    • T
      Avoid performing encoding conversion on command tag strings during EndCommand. · eb889266
      Tom Lane 提交于
      Since all current and foreseeable future command tags will be pure ASCII,
      there is no need to do conversion on them.  This saves a few cycles and also
      avoids polluting otherwise-pristine subtransaction memory contexts, which
      is the cause of the backend memory leak exhibited in bug #5302.  (Someday
      we'll probably want to have a better method of determining whether
      subtransaction contexts need to be kept around, but today is not that day.)
      
      Backpatch to 8.0.  The cycle-shaving aspect of this would work in 7.4
      too, but without subtransactions the memory-leak aspect doesn't apply,
      so it doesn't seem worth touching 7.4.
      eb889266
    • T
      Fix memory leakage introduced into print_aligned_text by 8.4 changes · 07be293a
      Tom Lane 提交于
      (failure to free col_lineptrs[] array elements) and exacerbated in the
      current devel cycle (failure to free "wrap").  This resulted in moderate
      bloat of psql over long script runs.  Noted while testing bug #5302,
      although what the reporter was complaining of was backend-side leakage.
      07be293a
  6. 30 1月, 2010 6 次提交