Re: Data corruption/loss when altering tables (fwd)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nicola Pero <n(dot)pero(at)mi(dot)flashnet(dot)it>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Data corruption/loss when altering tables (fwd)
Date: 2004-11-22 17:14:30
Message-ID: 16601.1101143670@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Nicola Pero <n(dot)pero(at)mi(dot)flashnet(dot)it> writes:
> I've been experiencing data corruption/loss in Postgresql 7.4.2.

> I tracked this down to altering tables. After I alter a table, I get data loss
> (fields becoming NULL with no reason!) unless I restart immediately the
> database server.

The problem shown in your example is simply that the UPDATE in the
plpgsql function has cached a plan that applies to the original format
of the table. You don't need to restart the server, but you do need to
start a fresh session to get rid of the obsolete cached plan.

There's a TODO item to cause cached plans to be flushed automatically
when a table changes, but I don't know when it will get done (not for
8.0, for sure).

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Fuhr 2004-11-22 17:54:44 Re: Data corruption/loss when altering tables (fwd)
Previous Message Ivan 2004-11-22 17:11:01 Re: Data corruption/loss when altering tables (fwd)