Re: ERROR: missing chunk number 0 for toast value

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Rushabh Lathia <rushabh(dot)lathia(at)enterprisedb(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: ERROR: missing chunk number 0 for toast value
Date: 2014-01-06 16:47:57
Message-ID: 20140106164757.GB15265@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-01-06 11:08:41 -0500, Robert Haas wrote:
> On Mon, Jan 6, 2014 at 9:47 AM, Andres Freund <andres(at)2ndquadrant(dot)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 :(

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-01-06 16:56:28 Re: generic pseudotype IO functions?
Previous Message Joe Conway 2014-01-06 16:41:50 Re: Compiling extensions on Windows