Обсуждение: MemoryContextAlloc: invalid request size 1969649011
hi everybody, this query...: my $tsql = qq{ insert into user_month (select '$currentmonth'::date as month,'*nopleid*',count(distinct uuid) from user_log where day<=now()::date and day>(now()-interval '30 days')::date) }; my $tsth = $tdbh->prepare( $tsql ); $tsth->execute(); sometimes drops this error: DBD::Pg::st execute failed: ERROR: MemoryContextAlloc: invalid request size 1969649011 the table user_log has about 2.000.000 entries and the following structure: Column | Type | Modifiers --------+------------------------+----------- day | date | uuid | character varying(31) | pleid | character varying(200) | Indexes: user_log_day_idx, user_log_pleid_idx, user_log_uuid_idx The system is postgresql-7.2-1PGDG on a redhat 7.2 system. Looks like the postgresql asks the system for some 2gb ram... thats quiet a lot (and i have read somewhere this is a magic border on intel systems). The query gets executed while entrys are inserted into user_log by other clients. Do i have to lock the table before against inserts? ideas? thanks Thilo Hille thilo@resourcery.de
"Thilo Hille" <thilo@resourcery.de> writes: > this query...: > my $tsql = qq{ insert into user_month (select '$currentmonth'::date as > month,'*nopleid*',count(distinct uuid) from user_log where day<=now()::date > and day>(now()-interval '30 days')::date) }; > my $tsth = $tdbh->prepare( $tsql ); > $tsth->execute(); > sometimes drops this error: > DBD::Pg::st execute failed: ERROR: MemoryContextAlloc: invalid request size > 1969649011 This looks to me like a corrupted-data issue --- specifically, the length word of some data value in the table has gotten clobbered and now appears ridiculously large. You should try to determine exactly which row(s) contain bad data. regards, tom lane
hi tom, > > sometimes drops this error: > > DBD::Pg::st execute failed: ERROR: MemoryContextAlloc: invalid request size > > 1969649011 > > This looks to me like a corrupted-data issue --- specifically, the > length word of some data value in the table has gotten clobbered and > now appears ridiculously large. > > You should try to determine exactly which row(s) contain bad data. the error only occurs sometimes. if some rows had been corrupted shouldnt it be reproduceable? anyway, i try a dump/restore. it should fail when the table has corrupted rows... regards Thilo Hille thilo@resourcery.de ----- Original Message ----- From: Tom Lane <tgl@sss.pgh.pa.us> To: Thilo Hille <thilo@resourcery.de> Cc: <pgsql-novice@postgresql.org> Sent: Thursday, August 08, 2002 4:25 AM Subject: Re: [NOVICE] MemoryContextAlloc: invalid request size 1969649011 > "Thilo Hille" <thilo@resourcery.de> writes: > > this query...: > > > my $tsql = qq{ insert into user_month (select '$currentmonth'::date as > > month,'*nopleid*',count(distinct uuid) from user_log where day<=now()::date > > and day>(now()-interval '30 days')::date) }; > > my $tsth = $tdbh->prepare( $tsql ); > > $tsth->execute(); > > > sometimes drops this error: > > DBD::Pg::st execute failed: ERROR: MemoryContextAlloc: invalid request size > > 1969649011 > > This looks to me like a corrupted-data issue --- specifically, the > length word of some data value in the table has gotten clobbered and > now appears ridiculously large. > > You should try to determine exactly which row(s) contain bad data. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >