* error context callback to let us supply a call-stack traceback. * If we are validating or executing an anonymous code block, the function * source text is passed as an argument. */
| 1000 | * source text is passed as an argument. |
| 1001 | */ |
| 1002 | static void |
| 1003 | plpgsql_compile_error_callback(void *arg) |
| 1004 | { |
| 1005 | if (arg) |
| 1006 | { |
| 1007 | /* |
| 1008 | * Try to convert syntax error position to reference text of original |
| 1009 | * CREATE FUNCTION or DO command. |
| 1010 | */ |
| 1011 | if (function_parse_error_transpose((const char *) arg)) |
| 1012 | return; |
| 1013 | |
| 1014 | /* |
| 1015 | * Done if a syntax error position was reported; otherwise we have to |
| 1016 | * fall back to a "near line N" report. |
| 1017 | */ |
| 1018 | } |
| 1019 | |
| 1020 | if (plpgsql_error_funcname) |
| 1021 | errcontext("compilation of PL/pgSQL function \"%s\" near line %d", |
| 1022 | plpgsql_error_funcname, plpgsql_latest_lineno()); |
| 1023 | } |
| 1024 | |
| 1025 | |
| 1026 | /* |
nothing calls this directly
no test coverage detected