<div>Thanks barwick,</div><div> </div><div><div>Is the process crash also expected,</div><div> </div><div><div>And dose anyone considered enhancing this API?</div></div></div><div> </div><div>05.02.2021, 10:55, "Ian Lawrence Barwick" <barwick(at)gmail(dot)com>:</div><blockquote><div><div><div>2021年2月5日(金) 11:38 sasa su <<a href="mailto:i(at)sasa(dot)su" rel="noopener noreferrer">i(at)sasa(dot)su</a>>:</div><blockquote style="border-left-color:rgb( 204 , 204 , 204 );border-left-style:solid;border-left-width:1px;margin:0px 0px 0px 0.8ex;padding-left:1ex"><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 <a href="https://github.com/Sasasu/worker_spi_table_not_exist" rel="noopener noreferrer" target="_blank">https://github.com/Sasasu/worker_spi_table_not_exist</a></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></blockquote><div> </div><div> </div><div>The list of return codes returned by SPI_exec is here:</div><div> </div><div> <a href="https://www.postgresql.org/docs/current/spi-spi-execute.html" rel="noopener noreferrer">https://www.postgresql.org/docs/current/spi-spi-execute.html</a></div><div> </div><div>and doesn't include "SPI_ERROR_REL_NOT_FOUND". The only</div><div>function which does return that is SPI_unregister_relation, see:</div><div> </div><div> <a href="https://www.postgresql.org/docs/current/spi-spi-unregister-relation.html" rel="noopener noreferrer">https://www.postgresql.org/docs/current/spi-spi-unregister-relation.html</a></div><div> </div><div> </div><div>Regards</div><div> </div><div>Ian Barwick</div></div><br /><br />--<div><div>EnterpriseDB: <a href="https://www.enterprisedb.com/" rel="noopener noreferrer" target="_blank">https://www.enterprisedb.com</a><div> </div></div></div></div></blockquote>