diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 1069013cd2a..6d9dd9cc9f9 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -2365,6 +2365,9 @@ _SPI_error_callback(void *arg) const char *query = (const char *) arg; int syntaxerrposition; + if (query == NULL) /* in case arg wasn't set yet */ + return; + /* * If there is a syntax error position, convert to internal syntax error; * otherwise treat the query as an item of context stack