diff options
| author | Tom Lane | 2012-02-01 07:14:37 +0000 |
|---|---|---|
| committer | Tom Lane | 2012-02-01 07:14:37 +0000 |
| commit | bef47331b6a1c0d081179a7fc9b82dd7e1862394 (patch) | |
| tree | ff0dcd912757135ff22cee4bbe2d0749d0069efd /src/pl | |
| parent | 4b77bfc37a1819fdfd3b767a52ff633cd28f9155 (diff) | |
Code review for plpgsql fn_signature patch.
Don't quote the output of format_procedure(); it's already quoted quite
enough. Remove the fn_name field, which was now just dead weight. Fix
remaining expected-output files.
Diffstat (limited to 'src/pl')
| -rw-r--r-- | src/pl/plpgsql/src/pl_comp.c | 2 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/pl_exec.c | 8 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/pl_funcs.c | 4 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/plpgsql.h | 1 | ||||
| -rw-r--r-- | src/pl/plpython/expected/plpython_error.out | 4 | ||||
| -rw-r--r-- | src/pl/plpython/expected/plpython_error_0.out | 4 |
6 files changed, 10 insertions, 13 deletions
diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c index 56b6d49d61..d43b8e0b1a 100644 --- a/src/pl/plpgsql/src/pl_comp.c +++ b/src/pl/plpgsql/src/pl_comp.c @@ -341,7 +341,6 @@ do_compile(FunctionCallInfo fcinfo, ALLOCSET_DEFAULT_MAXSIZE); compile_tmp_cxt = MemoryContextSwitchTo(func_cxt); - function->fn_name = pstrdup(NameStr(procStruct->proname)); function->fn_signature = format_procedure(fcinfo->flinfo->fn_oid); function->fn_oid = fcinfo->flinfo->fn_oid; function->fn_xmin = HeapTupleHeaderGetXmin(procTup->t_data); @@ -803,7 +802,6 @@ plpgsql_compile_inline(char *proc_source) ALLOCSET_DEFAULT_MAXSIZE); compile_tmp_cxt = MemoryContextSwitchTo(func_cxt); - function->fn_name = pstrdup(func_name); function->fn_signature = pstrdup(func_name); function->fn_is_trigger = false; function->fn_input_collation = InvalidOid; diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 57e337ee72..bf952b6247 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -798,7 +798,7 @@ plpgsql_exec_error_callback(void *arg) * translator: last %s is a phrase such as "during statement block * local variable initialization" */ - errcontext("PL/pgSQL function \"%s\" line %d %s", + errcontext("PL/pgSQL function %s line %d %s", estate->func->fn_signature, estate->err_stmt->lineno, _(estate->err_text)); @@ -809,7 +809,7 @@ plpgsql_exec_error_callback(void *arg) * translator: last %s is a phrase such as "while storing call * arguments into local variables" */ - errcontext("PL/pgSQL function \"%s\" %s", + errcontext("PL/pgSQL function %s %s", estate->func->fn_signature, _(estate->err_text)); } @@ -817,13 +817,13 @@ plpgsql_exec_error_callback(void *arg) else if (estate->err_stmt != NULL) { /* translator: last %s is a plpgsql statement type name */ - errcontext("PL/pgSQL function \"%s\" line %d at %s", + errcontext("PL/pgSQL function %s line %d at %s", estate->func->fn_signature, estate->err_stmt->lineno, plpgsql_stmt_typename(estate->err_stmt)); } else - errcontext("PL/pgSQL function \"%s\"", + errcontext("PL/pgSQL function %s", estate->func->fn_signature); } diff --git a/src/pl/plpgsql/src/pl_funcs.c b/src/pl/plpgsql/src/pl_funcs.c index 776e9f6139..b5a72ddba9 100644 --- a/src/pl/plpgsql/src/pl_funcs.c +++ b/src/pl/plpgsql/src/pl_funcs.c @@ -1461,7 +1461,7 @@ plpgsql_dumptree(PLpgSQL_function *func) PLpgSQL_datum *d; printf("\nExecution tree of successfully compiled PL/pgSQL function %s:\n", - func->fn_name); + func->fn_signature); printf("\nFunction's data area:\n"); for (i = 0; i < func->ndatums; i++) @@ -1538,6 +1538,6 @@ plpgsql_dumptree(PLpgSQL_function *func) dump_indent = 0; printf("%3d:", func->action->lineno); dump_block(func->action); - printf("\nEnd of execution tree of function %s\n\n", func->fn_name); + printf("\nEnd of execution tree of function %s\n\n", func->fn_signature); fflush(stdout); } diff --git a/src/pl/plpgsql/src/plpgsql.h b/src/pl/plpgsql/src/plpgsql.h index 739b9e48db..b63f336825 100644 --- a/src/pl/plpgsql/src/plpgsql.h +++ b/src/pl/plpgsql/src/plpgsql.h @@ -678,7 +678,6 @@ typedef struct PLpgSQL_func_hashkey typedef struct PLpgSQL_function { /* Complete compiled function */ - char *fn_name; char *fn_signature; Oid fn_oid; TransactionId fn_xmin; diff --git a/src/pl/plpython/expected/plpython_error.out b/src/pl/plpython/expected/plpython_error.out index 8c489923ce..8a4f571253 100644 --- a/src/pl/plpython/expected/plpython_error.out +++ b/src/pl/plpython/expected/plpython_error.out @@ -292,7 +292,7 @@ PL/Python function "python_traceback" SELECT sql_error(); ERROR: division by zero CONTEXT: SQL statement "select 1/0" -PL/pgSQL function "sql_error()" line 3 at SQL statement +PL/pgSQL function sql_error() line 3 at SQL statement SELECT python_from_sql_error(); ERROR: spiexceptions.DivisionByZero: division by zero CONTEXT: Traceback (most recent call last): @@ -306,7 +306,7 @@ CONTEXT: Traceback (most recent call last): plpy.execute("select sql_error()") PL/Python function "python_traceback" SQL statement "select python_traceback()" -PL/pgSQL function "python_from_sql_error()" line 3 at SQL statement +PL/pgSQL function python_from_sql_error() line 3 at SQL statement SELECT sql_from_python_error(); ERROR: spiexceptions.DivisionByZero: division by zero CONTEXT: Traceback (most recent call last): diff --git a/src/pl/plpython/expected/plpython_error_0.out b/src/pl/plpython/expected/plpython_error_0.out index 6cb2ed091b..b8d10dd735 100644 --- a/src/pl/plpython/expected/plpython_error_0.out +++ b/src/pl/plpython/expected/plpython_error_0.out @@ -292,7 +292,7 @@ PL/Python function "python_traceback" SELECT sql_error(); ERROR: division by zero CONTEXT: SQL statement "select 1/0" -PL/pgSQL function "sql_error" line 3 at SQL statement +PL/pgSQL function sql_error() line 3 at SQL statement SELECT python_from_sql_error(); ERROR: spiexceptions.DivisionByZero: division by zero CONTEXT: Traceback (most recent call last): @@ -306,7 +306,7 @@ CONTEXT: Traceback (most recent call last): plpy.execute("select sql_error()") PL/Python function "python_traceback" SQL statement "select python_traceback()" -PL/pgSQL function "python_from_sql_error" line 3 at SQL statement +PL/pgSQL function python_from_sql_error() line 3 at SQL statement SELECT sql_from_python_error(); ERROR: spiexceptions.DivisionByZero: division by zero CONTEXT: Traceback (most recent call last): |
