88a89,93 > struct > { > int sqlcode_varno; > int sqlerrm_varno; > } fict_vars; 104a110 > %type fict_vars_sect 251c257 < pl_block : decl_sect K_BEGIN lno proc_sect exception_sect K_END --- > pl_block : decl_sect fict_vars_sect K_BEGIN lno proc_sect exception_sect K_END 259c265 < new->lineno = $3; --- > new->lineno = $4; 263,264c269,272 < new->body = $4; < new->exceptions = $5; --- > new->body = $5; > new->exceptions = $6; > new->sqlcode_varno = $2.sqlcode_varno; > new->sqlerrm_varno = $2.sqlerrm_varno; 271a280,291 > fict_vars_sect : > { > plpgsql_ns_setlocal(false); > PLpgSQL_variable *var; > var = plpgsql_build_variable(strdup("sqlcode"), 0, > plpgsql_build_datatype(TEXTOID, -1), true); > $$.sqlcode_varno = var->dno; > var = plpgsql_build_variable(strdup("sqlerrm"), 0, > plpgsql_build_datatype(TEXTOID, -1), true); > $$.sqlerrm_varno = var->dno; > plpgsql_add_initdatums(NULL); > } 693a714 >