~ubuntu-branches/ubuntu/precise/postgresql-8.4/precise

« back to all changes in this revision

Viewing changes to src/backend/commands/tablecmds.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-04-20 16:10:45 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110420161045-nrk3s2t0szvn2o80
Tags: 8.4.8-0ubuntu0.11.04
* New upstream bug fix release: (LP: #767165)
  - If your installation was upgraded from a previous major release by
    running pg_upgrade, you should take action to prevent possible data loss
    due to a now-fixed bug in pg_upgrade. The recommended solution is to run
    "VACUUM FREEZE" on all TOAST tables.  More information is available at
    http://wiki.postgresql.org/wiki/20110408pg_upgrade_fix.
  - Fix pg_upgrade's handling of TOAST tables.
    This error poses a significant risk of data loss for installations
    that have been upgraded with pg_upgrade. This patch corrects the
    problem for future uses of pg_upgrade, but does not in itself cure
    the issue in installations that have been processed with a buggy
    version of pg_upgrade.
  - Suppress incorrect "PD_ALL_VISIBLE flag was incorrectly set"
    warning.
  - Disallow including a composite type in itself.
  - Avoid potential deadlock during catalog cache initialization.
  - Fix dangling-pointer problem in BEFORE ROW UPDATE trigger handling
    when there was a concurrent update to the target tuple.
  - Disallow "DROP TABLE" when there are pending deferred trigger
    events for the table.
    Formerly the "DROP" would go through, leading to "could not open
    relation with OID nnn" errors when the triggers were eventually
    fired.
  - Prevent crash triggered by constant-false WHERE conditions during
    GEQO optimization.
  - Improve planner's handling of semi-join and anti-join cases.
  - Fix selectivity estimation for text search to account for NULLs.
  - Improve PL/pgSQL's ability to handle row types with dropped columns.
  - Fix PL/Python memory leak involving array slices.
  - Fix pg_restore to cope with long lines (over 1KB) in TOC files.
  - Put in more safeguards against crashing due to division-by-zero
    with overly enthusiastic compiler optimization. (Closes: #616180)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3613
3613
        typeOid = HeapTupleGetOid(typeTuple);
3614
3614
 
3615
3615
        /* make sure datatype is legal for a column */
3616
 
        CheckAttributeType(colDef->colname, typeOid);
 
3616
        CheckAttributeType(colDef->colname, typeOid,
 
3617
                                           list_make1_oid(rel->rd_rel->reltype));
3617
3618
 
3618
3619
        /* construct new attribute's pg_attribute entry */
3619
3620
        attribute.attrelid = myrelid;
5606
5607
        targettype = typenameTypeId(NULL, typename, &targettypmod);
5607
5608
 
5608
5609
        /* make sure datatype is legal for a column */
5609
 
        CheckAttributeType(colName, targettype);
 
5610
        CheckAttributeType(colName, targettype,
 
5611
                                           list_make1_oid(rel->rd_rel->reltype));
5610
5612
 
5611
5613
        /*
5612
5614
         * Set up an expression to transform the old data value to the new type.