Re: proposal - plpgsql unique statement id
От | Pavel Stehule |
---|---|
Тема | Re: proposal - plpgsql unique statement id |
Дата | |
Msg-id | CAFj8pRBWwxq5o1ATsRxXRCGLeptiOROg-aGqtWfQUXzgJbOuiA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: proposal - plpgsql unique statement id (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
čt 24. 1. 2019 v 23:08 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> committed
Why didn't this patch modify the dumping logic in pl_funcs.c to print
the IDs? I'm not aware of other cases where we intentionally omit
fields from debug-support printouts.
Currently we don't print lineno, what is maybe for user more important information.
I looked to the code, and now I am thinking so it is little bit harder, than I expected. Any new information can break output formatting
static void
dump_loop(PLpgSQL_stmt_loop *stmt)
{
dump_ind();
printf("LOOP\n");
dump_stmts(stmt->body);
dump_ind();
printf(" ENDLOOP\n");
}
dump_loop(PLpgSQL_stmt_loop *stmt)
{
dump_ind();
printf("LOOP\n");
dump_stmts(stmt->body);
dump_ind();
printf(" ENDLOOP\n");
}
can looks like
static void
dump_loop(PLpgSQL_stmt_loop *stmt, int stmtid_width)
{
dump_ind();
printf("%*d LOOP\n", stmtid_width, stmt->stmtid);
dump_stmts(stmt->body);
dump_ind();
printf(" ENDLOOP\n");
}
dump_loop(PLpgSQL_stmt_loop *stmt, int stmtid_width)
{
dump_ind();
printf("%*d LOOP\n", stmtid_width, stmt->stmtid);
dump_stmts(stmt->body);
dump_ind();
printf(" ENDLOOP\n");
}
It is some what do you expect ?
Regards
Maybe more simple
static void
dump_loop(PLpgSQL_stmt_loop *stmt, int stmtid_width)
{
dump_ind();
printf("LOOP {%d}\n",stmt->stmtid);
dump_stmts(stmt->body);
dump_ind();
printf(" ENDLOOP\n");
}
dump_loop(PLpgSQL_stmt_loop *stmt, int stmtid_width)
{
dump_ind();
printf("LOOP {%d}\n",stmt->stmtid);
dump_stmts(stmt->body);
dump_ind();
printf(" ENDLOOP\n");
}
Pavel
regards, tom lane
В списке pgsql-hackers по дате отправления: