Re: PL/Perl: spi_prepare() and RETURNING

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PL/Perl: spi_prepare() and RETURNING
Дата
Msg-id 8690.1156446082@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PL/Perl: spi_prepare() and RETURNING  (David Fetter <david@fetter.org>)
Ответы Re: PL/Perl: spi_prepare() and RETURNING
Re: PL/Perl: spi_prepare() and RETURNING
Список pgsql-hackers
David Fetter <david@fetter.org> writes:
>> I've found a little lacuna in the RETURNING feature, that being in
>> PL/Perl's spi_prepare()/spi_execute_prepared() as illustrated in the
>> attached file on CVS TIP.

It looks like plperl_spi_execute_fetch_result only expects to find
tuples returned if the status is SPI_OK_SELECT.  pltcl and plpython
have likely got similar issues.

This reminds me of a consideration I had been intending to bring up on
the mailing lists: what exactly do we want to do with the SPI API for
RETURNING queries?  The current behavior is that it still returns
SPI_OK_INSERT and so on, but also creates a SPI_tuptable.  Is this
what we want?  Perhaps we should invent additional return codes
SPI_OK_INSERT_RETURNING etc.

Another issue I noted in that same area is that spi.c does not set
SPI_processed for a utility statement, even if the utility statement
returns tuples.  Is this a bug, or should we leave it alone?
        regards, tom lane


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

Предыдущее
От: Zoltan Boszormenyi
Дата:
Сообщение: Re: [PATCHES] COPY view
Следующее
От: Bernd Helmle
Дата:
Сообщение: Re: [PATCHES] Updatable views