Re: [HACKERS][BUG] Cache invalidation for queries that contains constof temporary composite type - Mailing list pgsql-hackers

From Maksim Milyutin
Subject Re: [HACKERS][BUG] Cache invalidation for queries that contains constof temporary composite type
Date
Msg-id 76c8a750-201a-bc06-9d29-90a5725b0ae7@gmail.com
Whole thread Raw
In response to Re: [HACKERS][BUG] Cache invalidation for queries that containsconst of temporary composite type  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
Hi HORIGUCHI-san!


Thanks for the valuable comments.


03.10.17 4:30, Kyotaro HORIGUCHI wrote:

> The first thought that patch gave me is that the problem is not
> limited to constants. Actually the following sequence also
> reproduces similar failure even with this patch.
>
> create table t2 (x int , y int);
> create type pair as (x int, y int);
> prepare test as select row(x, y)::pair from t2;
> drop type pair;
> execute test;
> | ERROR:  cache lookup failed for type 16410
>
> In this case the causal expression is in the following form.
>
>    TargetEntry (
>      expr = (
>        RowExpr:
>          typeid = 16410,
>          row_format = COERCE_EXPLICIT_CAST,
>          args = List (Var(t2.x), Var(t2.y))
>      )
>    )

Yeah, RowExpr has no dependency from type relation with oid=16410. I 
think the routine 'fix_expr_common' needs to be reworked to take into 
account any possible dependencies of expression from composite type.

On November commitfest I'll lay out patch that covers your case.

-- 
Regards,
Maksim Milyutin



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Nico Williams
Date:
Subject: Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints
Next
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] [sqlsmith] stuck spinlock in pg_stat_get_wal_receiverafter OOM