Re: [BUG] Cache invalidation for queries that contains const of temporary composite type

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Maksim Milyutin <milyutinma(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUG] Cache invalidation for queries that contains const of temporary composite type
Date: 2017-10-02 23:41:34
Message-ID: CAPpHfdtCuh5UVezbjA2W+a-tPqXQ6xjAjeH6yyZ1DzxHOSwfsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 3, 2017 at 12:20 AM, Maksim Milyutin <milyutinma(at)gmail(dot)com>
wrote:

> I have tested the following case:
>
> create type pair as (x int, y int);
> prepare test as select json_populate_record(null::pair, '{"x": 1, "y":
> 2}'::json);
> drop type pair cascade;
>
> execute test;
>
> -- The following output is obtained before patch
> ERROR: cache lookup failed for type 16419
>
> -- After applying patch
> ERROR: type "pair" does not exist
>
> But after recreating 'pair' type I'll get the following message:
> ERROR: cached plan must not change result type
>
> I don't know whether it's right behavior. Anyhow your point is a good
> motivation to experiment and investigate different scenarios of work with
> cached plan that depends on non-stable type. Thanks for that.
>

I think ideally, cached plan should be automatically invalidated and stored
procedure should work without error.
Not really sure if it's feasible...

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-10-02 23:50:51 Re: Horrible CREATE DATABASE Performance in High Sierra
Previous Message Andres Freund 2017-10-02 23:32:37 Re: Horrible CREATE DATABASE Performance in High Sierra