Excerpts from Josh Berkus's message of vie oct 14 14:16:43 -0300 2011:
>
> > Maybe set the verbosity to a lower level in the function? I dunno if
> > plpgsql lets you do that though. We have a GUC that controls the server
> > log verbosity, and psql can do it too; but plpgsql is sort of in
> > between.
>
> The problem is that there is no level of verbosity which will supress
> the CONTEXT messages and not supress the INFO messages as well. Not
> that I've found, anyway.
I meant verbosity, not error level. This quick test shows what I meant
-- but it doesn't work; the server log is altered as I expected (and does not
include the context lines), but not plpgsql's:
alvherre=# create function f() returns void language plpgsql as $$ begin raise info 'hello'; end $$;
CREATE FUNCTION
alvherre=# select f();
INFO: hellof
---
(1 fila)
alvherre=# create function g() returns void language plpgsql as $$ begin perform f(); end $$;
CREATE FUNCTION
alvherre=# select g();
INFO: hello
CONTEXTO: SQL statement "SELECT f()"
función PL/pgSQL «g» en la línea 1 en PERFORMg
---
(1 fila)
alvherre=# alter function g() set log_error_verbosity to 'terse';
ALTER FUNCTION
alvherre=# select g();
INFO: hello
CONTEXTO: SQL statement "SELECT f()"
función PL/pgSQL «g» en la línea 1 en PERFORMg
---
(1 fila)
alvherre=# alter function f() set log_error_verbosity to 'terse';
ALTER FUNCTION
alvherre=# select g();
INFO: hello
CONTEXTO: SQL statement "SELECT f()"
función PL/pgSQL «g» en la línea 1 en PERFORMg
---
(1 fila)
--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support