回复:BUG #15766: discard plans bug. database CRASH

From: 周正中(德歌) <dege(dot)zzz(at)alibaba-inc(dot)com>
To: "digoal" <digoal(at)126(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-bugs" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: 回复:BUG #15766: discard plans bug. database CRASH
Date: 2019-04-18 01:37:17
Message-ID: 1feb513d-ad8f-4dfa-ac18-c302efd997fa.dege.zzz@alibaba-inc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thank you , it's likely a bug caused by pg_hint_plan extension , it's not a pg's bug.
i comment the pg_hint_plan , and will not crash now.

```
#shared_preload_libraries = 'oracle_fdw,pg_hint_plan' # (change requires restart)
restart pg.

postgres=# prepare a(int) as select * from tf where id=$1;
PREPARE
postgres=# \d tf
Table "public.tf"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+--------------------------------
id | integer | | not null | nextval('tf_id_seq'::regclass)

postgres=# execute a(1);
id
----
(0 rows)

postgres=# insert into tf values (1);
INSERT 0 1
postgres=# insert into tf values (2);
INSERT 0 1
postgres=# execute a(1);
id
----
1
(1 row)

postgres=# alter table tf add column c1 int;
ALTER TABLE
postgres=# execute a(1);
ERROR: cached plan must not change result type
postgres=# \set VERBOSITY verbose
postgres=# execute a(1);
ERROR: 0A000: cached plan must not change result type
LOCATION: RevalidateCachedQuery, plancache.c:723
postgres=# discard plans;
DISCARD PLANS
postgres=# execute a(1);
ERROR: 0A000: cached plan must not change result type
LOCATION: RevalidateCachedQuery, plancache.c:723
postgres=# execute a(1);
ERROR: 0A000: cached plan must not change result type
LOCATION: RevalidateCachedQuery, plancache.c:723
```

best regards,
digoal.
------------------------------------------------------------------
发件人:Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
发送时间:2019年4月18日(星期四) 01:09
收件人:digoal <digoal(at)126(dot)com>
抄 送:pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
主 题:Re: BUG #15766: discard plans bug. database CRASH

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> PostgreSQL version: 11.1

> discard plans bug. database CRASH

This seems to be fixed already; I just get additional reports of

ERROR: cached plan must not change result type

in all branches. I didn't go through the git logs to try to
identify the relevant fix, so possibly it was post-11.2.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Fabrizio Mazzoni 2019-04-18 03:11:07 pgAdmin bug?
Previous Message Igor Neyman 2019-04-17 21:06:36 RE: Re: BUG #15769: The database cluster intialisation failed.