From: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: [BUG] plpgsql RETURN QUERY with toasted fields -vs- DROP/TRUNCATE
Date: Fri, 4 Sep 2020 17:02:13 +0200
Message-ID: <20200904170213.12547fb8@firost> (raw)
In-Reply-To: <3568911.1598723239@sss.pgh.pa.us>
References: <20200828174342.2ac34e27@firost>
<3568911.1598723239@sss.pgh.pa.us>
On Sat, 29 Aug 2020 13:47:19 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Jehan-Guillaume de Rorthais <jgdr@dalibo.com> writes:
> > We discovered a bug in plpgsql.
> > When using RETURN QUERY on a relation with some toasted values and when this
> > relaiton is later dropped or truncated, an error is raised at the end of the
> > function.
>
> This isn't particularly RETURN QUERY's fault; there are any number of ways
> to produce the same sort of error. I reproduced it with
> [...]
Indeed. Thanks.
> I guess we could forcibly detoast values in enough places to close all the
> gaps, but the performance costs might be annoying. I think a case can
> definitely be made for saying "don't do that".
What do you mean? Writing in configuration to not drop a relation in a function
where some past computed results depend on it?
> (Another idea, perhaps, might be to detoast only in volatile functions,
> reasoning that a nonvolatile one can't drop the table.)
Would it be possible to detoast values iif the related relation are dropped
later?
Regards,
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: jgdr@dalibo.com, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org
Subject: Re: [BUG] plpgsql RETURN QUERY with toasted fields -vs- DROP/TRUNCATE
In-Reply-To: <20200904170213.12547fb8@firost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox