Re: proposal: schema variables

Поиск
Список
Период
Сортировка
От Haritabh Gupta
Тема Re: proposal: schema variables
Дата
Msg-id 177261853144.1094601.11795093672679754617.pgcf@coridan.postgresql.org
обсуждение
Ответ на Re: proposal: schema variables  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: proposal: schema variables
Re: proposal: schema variables
Список pgsql-hackers
Hi,

While reviewing I came across this behaviour and wanted to
check whether it's intended:

    CREATE TEMP VARIABLE y AS int;
    LET y = 42;

    BEGIN;
    SAVEPOINT s1;
    LET y = generate_series(1,2);  -- ERROR: too many rows
    ROLLBACK TO s1;
    SELECT VARIABLE(y);            -- returns 1, not 42

It looks like svariableReceiveSlot writes the first row to the
variable (pfree'ing the old datum) before the second row triggers the
error, so the old value is lost even though LET failed.

I understand variable values are intentionally non-transactional, but
is it expected that a failed LET has this side effect? 

---
Haritabh Gupta
Supabase

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