Re: plpgsql fails to reinitialize record variables at block re-entry

2017-12-09 Thread Tom Lane
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

Re: plpgsql fails to reinitialize record variables at block re-entry

2017-12-08 Thread Pavel Stehule
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

plpgsql fails to reinitialize record variables at block re-entry

2017-12-08 Thread 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 not-yet-assigned record is indeterminate. CONTEXT: SQL statement "SELECT r" PL/pgSQL