'Create table if not exists as' breaks SPI_execute

Started by Stas Kelvichabout 10 years ago3 messageshackers
Jump to latest
#1Stas Kelvich
s.kelvich@postgrespro.ru

Hi.

SPI_execute assumes that CreateTableAsStmt always have completionTag == “completionTag”.
But it isn’t true in case of ‘IF NOT EXISTS’ present.

Attachments:

spi-cta.patchapplication/octet-stream; name=spi-cta.patchDownload+9-3
#2Stas Kelvich
s.kelvich@postgrespro.ru
In reply to: Stas Kelvich (#1)
Re: 'Create table if not exists as' breaks SPI_execute

On 11 Apr 2016, at 18:41, Stas Kelvich <s.kelvich@postgrespro.ru> wrote:

Hi.

SPI_execute assumes that CreateTableAsStmt always have completionTag == “completionTag”.
But it isn’t true in case of ‘IF NOT EXISTS’ present.

<spi-cta.patch>

Sorry, I meant completionTag == “SELECT”.

--
Stas Kelvich
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stas Kelvich (#1)
Re: 'Create table if not exists as' breaks SPI_execute

Stas Kelvich <s.kelvich@postgrespro.ru> writes:

SPI_execute assumes that CreateTableAsStmt always have completionTag == “completionTag”.
But it isn’t true in case of ‘IF NOT EXISTS’ present.

Pushed, thanks.

regards, tom lane

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