Re: Bug in prepared statement cache invalidation?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in prepared statement cache invalidation?
Date: 2017-05-03 01:09:14
Message-ID: CA+Tgmoa3_KcUd+KoCp4aL2gWyPTHf0B9Siq4OiR7e4fbsPSvKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 2, 2017 at 5:50 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Yeah. I think there should be a way to tell a PL to flush any
>> internal caches it is maintaining, some variant of DISCARD. But that
>> would require a bunch of code that nobody's written yet.
>
> That mechanism already exists, so far as the core code is concerned:
> register a syscache inval callback. But you're right, getting plpgsql
> to actually do anything about changes in composite types would require
> a bunch of code that nobody's written yet.

Well, that'd be a way of doing automatic invalidations, not manual
ones. Making DISCARD PROCEDURAL LANGUAGE CRAP work would a different
pile of code.

> If you'll pardon my bashing on a long-deceased horse, this would be
> noticeably easier if we stopped using the PLPGSQL_DTYPE_ROW code
> paths for composite-type variables. That mechanism was really
> designed for cases like "SELECT ... INTO a,b,c" where the row
> contents are fully determined by the function text. It's practically
> impossible to make it cope with dynamic changes; at the very least
> you have to recompile the whole function.

I guess that's also a project in need of some round tuits.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-05-03 01:09:57 renaming "transaction log"
Previous Message Jeff Davis 2017-05-03 01:01:31 Re: [POC] hash partitioning