Re: BUG #16268: SPI_getvalue requires IsTransactionState butTextDatumGetCString of SPI_getbinval - not!

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #16268: SPI_getvalue requires IsTransactionState butTextDatumGetCString of SPI_getbinval - not!
Дата
Msg-id 20200220053131.GJ2288@paquier.xyz
обсуждение исходный текст
Ответ на BUG #16268: SPI_getvalue requires IsTransactionState but TextDatumGetCString of SPI_getbinval - not!  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Thu, Feb 20, 2020 at 05:06:24AM +0000, PG Bug reporting form wrote:
> const char *data = SPI_getvalue(SPI_tuptable->vals[row],
> SPI_tuptable->tupdesc, SPI_fnumber(SPI_tuptable->tupdesc, "data"));
>
> raise TRAP: FailedAssertion("!(IsTransactionState())", File: "catcache.c",
> Line: 1213)

Catalog cache lookups have to happen in the context of a transaction,
this is what this assertion failure means, so your code is doing
something incorrect.  We have such examples of short-term transactions
opened in the PostgreSQL code for some cache lookups.
IdentifySystem() in walsender.c looking for the database name is one
such example (see StartTransactionCommand and CommitTransactionCommand).
--
Michael

Вложения

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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16268: SPI_getvalue requires IsTransactionState but TextDatumGetCString of SPI_getbinval - not!
Следующее
От: egocenter
Дата:
Сообщение: Re: Full text search bug ('russian' regconfig)