SPI: process exit in SPI_exec when table not exist. error code not return.

From: sasa su <i(at)sasa(dot)su>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: SPI: process exit in SPI_exec when table not exist. error code not return.
Date: 2021-02-05 02:38:17
Message-ID: 926251612491422@mail.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

<div>Hi.</div><div> </div><div>When running a query with a not exist table in SPI_exec. the process exit with -1 in SPI_exec function.</div><div>the error code SPI_ERROR_REL_NOT_FOUND never return.</div><div> </div><div>I made a minimal reproduction code in https://github.com/Sasasu/worker_spi_table_not_exist</div><div> </div><div>The core code is:</div><div> </div><div><div>   int spi = SPI_exec("select * from not_exist_table", 0);</div><div>   // can not reach here<br />   Assert(spi == SPI_ERROR_REL_NOT_FOUND);</div></div><div> </div><div><div>I think it is a bug, PG_TRY macro it not mentioned in SPI document.</div><div><div>The code inside SPI should be wrapped with PG_TRY macro.</div></div></div>

Attachment Content-Type Size
unknown_filename text/html 725 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-02-05 02:51:17 Re: psql tab completion for CREATE DATABASE ... LOCALE
Previous Message Michael Paquier 2021-02-05 02:17:48 Re: Preserve attstattarget on REINDEX CONCURRENTLY