Is it safe to ignore the return value of SPI_finish and SPI_execute?

Поиск
Список
Период
Сортировка
От Mark Dilger
Тема Is it safe to ignore the return value of SPI_finish and SPI_execute?
Дата
Msg-id 04E56988-5025-48CF-85E2-02301ACD0D59@gmail.com
обсуждение исходный текст
Ответы Re: Is it safe to ignore the return value of SPI_finish and SPI_execute?
Список pgsql-hackers
Hackers,

most places that use SPI_connect ... SPI_finish check the
return value of SPI_finish and elog if it failed.  There
are a few places that do not, and it is unclear to me
why this is safe.  SPI_finish appears to be needed to
clean up memory contexts.

Examples can be found in:
  src/backend/utils/adt/xml.c
  src/backend/utils/adt/tsvector_op.c
  src/backend/utils/adt/tsquery_rewrite.c
  src/test/regress/regress.c
  contrib/spi/refint.c

The return value of SPI_execute is ignored in one spot:
  src/backend/utils/adt/xml.c circa line 2465.

I checked the archives and did not see any discussion
about this in the past.  Please excuse me if this has
been asked before.





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pgindent run next week?
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pgindent run next week?