Fix _SPI_execute_plan() for CREATE TABLE IF NOT EXISTS foo AS ...

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 079013f0b7e35f2fb14cdbe2667a1d9aac4f770e
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2016-04-12T00:07:17Z
Releases: 9.5.3
Fix _SPI_execute_plan() for CREATE TABLE IF NOT EXISTS foo AS ...

When IF NOT EXISTS was added to CREATE TABLE AS, this logic didn't get
the memo, possibly resulting in an Assert failure.  It looks like there
would have been no ill effects in a non-Assert build, though.  Back-patch
to 9.5 where the IF NOT EXISTS option was added.

Stas Kelvich

Files

PathChange+/−
src/backend/executor/spi.c modified +12 −4