Pavel Stehule writes:
> 2017-12-09 7:24 GMT+01:00 Tom Lane :
>> Surely that ought to have failed at the i=2 iteration. There is
>> code in plpgsql's exec_stmt_block() that tries to reinitialize
>> PLPGSQL_DTYPE_REC variables, but it's never reached
2017-12-09 7:24 GMT+01:00 Tom Lane :
> Consider
>
> regression=# do $$
> regression$# declare r record;
> regression$# begin
> regression$# raise notice '%', r;
> regression$# end$$;
> ERROR: record "r" is not assigned yet
> DETAIL: The tuple structure of a
Consider
regression=# do $$
regression$# declare r record;
regression$# begin
regression$# raise notice '%', r;
regression$# end$$;
ERROR: record "r" is not assigned yet
DETAIL: The tuple structure of a not-yet-assigned record is indeterminate.
CONTEXT: SQL statement "SELECT r"
PL/pgSQL