PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15766
PG Version11.1
OSCENTOS 7.X X64
Opened2019-04-17 08:56:01+00
Reported byZhou Digoal
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15766
Logged by:          Zhou Digoal
Email address:      (redacted)
PostgreSQL version: 11.1
Operating system:   CENTOS 7.X X64
Description:        

discard plans bug. database CRASH 

for exp:

```
postgres=# create table tc (id int ,c1 int, c2 int);
CREATE TABLE
postgres=# insert into tc values (1,1,1);
INSERT 0 1
postgres=# prepare x (int) as select * from tc where  id=$1;
PREPARE
postgres=# execute x(1);
 id | c1 | c2 
----+----+----
  1 |  1 |  1
(1 row)

postgres=# alter table tc add column c3 int;
ALTER TABLE
postgres=# execute x(1);
ERROR:  0A000: cached plan must not change result type
LOCATION:  RevalidateCachedQuery, plancache.c:723
postgres=# \h discard
Command:     DISCARD
Description: discard session state
Syntax:
DISCARD { ALL | PLANS | SEQUENCES | TEMPORARY | TEMP }

postgres=# discard plans;
DISCARD PLANS
```


and then reexecute , database will crash.

```
postgres=# execute x(1);
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!> \q
```

best regards,
digoal

Messages

DateAuthorSubject
2019-04-17 08:56:01+00PG Bug reporting formBUG #15766: discard plans bug. database CRASH
2019-04-17 17:00:23+00Tom LaneRe: BUG #15766: discard plans bug. database CRASH