Re: Checking return value of SPI_execute

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Checking return value of SPI_execute
Дата
Msg-id 20191107021356.GC1768@paquier.xyz
обсуждение исходный текст
Ответ на Re: Checking return value of SPI_execute  (Mark Dilger <hornschnorter@gmail.com>)
Список pgsql-hackers
On Wed, Nov 06, 2019 at 07:35:18AM -0800, Mark Dilger wrote:
> Other code that checks the return value from an SPI function is inconsistent
> about whether it checks for SPI_OK_SELECT or simply checks for a negative
> result.  I was on the fence about which precedent to follow, and was just
> slightly in favor of testing for negative rather than SPI_OK_SELECT due to
> this function, query_to_oid_list, taking the query string as an argument and
> not controlling whether that argument is indeed a plain SELECT.
>
> I don't feel strongly about it.

The code relies on SELECT queries now to fetch a list of relation
OIDs and it is read-only.  If it happens that another query type makes
sense for this code path, then the person using the routine will need
to think about what to do when seeing the new error.  The current code
exists for ages, so I have applied your change only on HEAD.
--
Michael

Вложения

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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: [PATCH] Do not use StdRdOptions in Access Methods
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: RFC: split OBJS lines to one object per line