Thread

  1. Database corruption caused by long insert strings

    andrew@mycomport.com — 2000-05-03T05:47:15Z

    The system: Linux RedHat 6.2, running postgresql 6.5.3 (installed from the
    RH 6.2 RPM)
    
    The bug: attempts to insert large strings result in database
    corruption.  Not only does the attempted insert fail with a "too
    large" error, but the table is corrupted, and further accesses can cause
    the system to crash.
    
    I originally discovered this bug while accessing the database using Perl,
    but managed to replicate the problem using the command-line tools only.
    
    Test case:
    Create a database, connect to it using psql.
    
    testdb=>CREATE TABLE test (testcol text);
    CREATE
    testdb=>INSERT INTO test (testcol) values (<a really long string literal>);
    ERROR:  Tuple is too big: size 10584
    
    At this point, the database is corrupt.  "Vacuum"ing the database will
    detect and fix the corruption, but further queries without vacuuming may
    cause the system to crash (the postmaster daemon consumes all available
    CPU cycles).  I have not determined exactly how to trigger this.
    
    
    Thanks for an (otherwise) excellent product :-)
    
    Andrew Bishop
    
    
    
  2. Re: Database corruption caused by long insert strings

    Peter Eisentraut <e99re41@docs.uu.se> — 2000-05-03T09:07:43Z

    On Wed, 3 May 2000 andrew@mycomport.com wrote:
    
    > The bug: attempts to insert large strings result in database
    > corruption.  Not only does the attempted insert fail with a "too
    > large" error, but the table is corrupted, and further accesses can cause
    > the system to crash.
    
    That's a known and fixed problem. Feel free to try our new product 7.0 --
    should be out on Monday last I heard.
    
    
    -- 
    Peter Eisentraut                  Sernanders väg 10:115
    peter_e@gmx.net                   75262 Uppsala
    http://yi.org/peter-e/            Sweden