Skip site navigation (1) Skip section navigation (2)

Backend crash while indexing large strings

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Backend crash while indexing large strings
Date: 2001-02-08 21:34:21
Message-ID: 200102082134.f18LYLa25492@hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Stephen van Egmnond (svanegmond(at)home(dot)com) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
Backend crash while indexing large strings

Long Description
The attached sql crashed Postgres 7.0.2 on a debian linux system (intel), using the packages 7.0.2-6.

The crash exhibits a wierd dynamic. Any of the following will avert a crash:

* remove the foo_key primary key and associated inserts
* remove the insert just before the index
* insert fewer large strings, e.g. 10 instead of 100. On my system, the magic number is 16.

Sample Code
drop table foo;
create table foo (
        foo_key integer,
        random  varchar(1000)
);
create sequence foo_sequence start 200;

-- create a pl/sql procedure
drop function thrash_database(integer);
create function  thrash_database(integer) RETURNS integer AS '
declare
        i integer;
        v_number_of_rows alias for $1;
begin
  FOR i IN 1..v_number_of_rows LOOP
    insert into foo (foo_key, random) values (nextval(''foo_sequence''), ''abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'');
  END LOOP;
return 1;
END;
' language 'plpgsql';

-- change 100 to 10 to avert a crash.
select thrash_database(100);

-- comment out the following line to avert a crash
insert into foo values (1, '1');

create index foo_on_random on foo ( random );

No file was uploaded with this report


Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2001-02-08 22:25:34
Subject: Re: Backend crash while indexing large strings
Previous:From: Constantin TeodorescuDate: 2001-02-08 17:43:49
Subject: Re: Problem displaying functions and views in 7.1b3

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group