citusdata / citusdata/citus

Introduce spi_xxx_or_error wrappers

Open
#4,460 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

I have seen that the pattern we follow to use `spi_execute` & `spi_finish` seems a lot similar in some places.

```c
if (spiResult != SPI_OK_UTILITY)
{
ereport(ERROR, (errmsg("could not run SPI query")));
}

if (spiResult != SPI_OK_FINISH)
{
ereport(ERROR, (errmsg("could not finish SPI connection")));
}
```

Might be better if we can introduce wrappers around spi_execute & spi_finish to automatically error out without doing those extra checks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.