Removing Context messages

From: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Removing Context messages
Date: 2008-04-07 04:16:51
Message-ID: 062401c89866$34e506d0$8f01010a@iptel.com.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi list,

I'm having trouble removing some context messages in psql and/or pgadmin.
I made a simple example to show this with 2 functions: f_outer which loops
through a recordset and calls f_inner for each record.

Context messages appear only when the f_inner function logs. (Would be nice
to know why these CONTEXT notices appear).
This is the output I'm getting:

pg=> select f_outer();
NOTICE: f_outer: 3
NOTICE: f_inner: 3 = [HEVIA]
CONTEXT: SQL statement "SELECT f_inner( $1 )"
PL/pgSQL function "f_outer" line 9 at perform
NOTICE: f_outer: 6
NOTICE: f_inner: 6 = [GUIDARA]
CONTEXT: SQL statement "SELECT f_inner( $1 )"
PL/pgSQL function "f_outer" line 9 at perform
NOTICE: f_outer: 7
NOTICE: f_inner: 7 = [MASTROIANI]
CONTEXT: SQL statement "SELECT f_inner( $1 )"
PL/pgSQL function "f_outer" line 9 at perform
f_outer
---------

(1 row)

I want to get rid of the CONTEXT messages.
I have tried in psql with "\set VERBOSITY terse" without success. No idea on
what to try on pgadmin though.

Thanks,
Fernando

--- Function declaration follows in case it helps ---
CREATE OR REPLACE FUNCTION f_inner(p_client numeric(10)) RETURNS void AS
$BODY$
DECLARE
r_clients clientes%ROWTYPE;
BEGIN
SELECT * INTO r_clients FROM clientes WHERE id_cliente = p_client;
RAISE NOTICE 'f_inner: % = [%]', p_client, r_clients.apellido;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;

CREATE OR REPLACE FUNCTION f_outer() RETURNS void AS
$BODY$
DECLARE
r_clients clientes%ROWTYPE;
BEGIN
FOR r_clients IN SELECT * FROM CLIENTES
LOOP
RAISE NOTICE 'f_outer: %', r_clients.id_cliente;
PERFORM f_inner(r_clients.id_cliente);
END LOOP;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-04-07 04:36:48 Re: Removing Context messages
Previous Message Naz Gassiep 2008-04-07 04:11:56 Query optimisation