Re: ERROR: missing chunk number 0 for toast value - Mailing list pgsql-hackers

From Robert Haas
Subject Re: ERROR: missing chunk number 0 for toast value
Date
Msg-id CA+TgmoY7u8Xof-pFVMzsy+hoRy8Wq-RZeojvsTfdzMqbvMJHVw@mail.gmail.com
Whole thread Raw
In response to Re: ERROR: missing chunk number 0 for toast value  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: ERROR: missing chunk number 0 for toast value
Re: ERROR: missing chunk number 0 for toast value
List pgsql-hackers
On Mon, Jan 6, 2014 at 11:47 AM, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2014-01-06 11:08:41 -0500, Robert Haas wrote:
>> On Mon, Jan 6, 2014 at 9:47 AM, Andres Freund <andres@2ndquadrant.com> wrote:
>> > On 2014-01-06 09:43:45 -0500, Robert Haas wrote:
>> >> > I actually vote for not allowing doing so at all by erroring out when
>> >> > accessing a plpgsql variable created in an aborted subxact, unless you
>> >> > explicitly signal that you want to do do so by calling some function
>> >> > deleting the information about which subxact a variable was created
>> >> > in. I have seen several bugs caused by people assuming that EXCEPTION
>> >> > BLOCK/subtransaction rollback had some kind of effects on variables
>> >> > created in them. And we just don't have much support for doing anything
>> >> > in that direction safely.
>> >>
>> >> So, you want to let users do things that are unsafe, but only if they
>> >> ask nicely?  That hardly seems right.
>> >
>> > Well, no. If they have to use that function explicitly *before* the
>> > subxact aborted, we can copy & detoast the value out of that context
>> > safely.
>>
>> Oh, I see.  I think that's pretty icky.  Users won't expect (and will
>> complain about) such restrictions.
>
> Yea. But at least it would fail reliably instead of just under
> concurrency and other strange circumstances - and there'd be a safe way
> out. Currently there seem to be all sorts of odd behaviour possible.
>
> I simply don't have a better idea :(

Is "forcibly detoast everything" a complete no-go?  I realize there
are performance concerns with that approach, but I'm not sure how
realistic a worry it actually is.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: In-core regression tests for replication, cascading, archiving, PITR, etc. Michael Paquier
Next
From: Robert Haas
Date:
Subject: Re: Add CREATE support to event triggers