Обсуждение: Removing Context Messages
Hi list,<br /><br />How do I remove CONTEXT messages from being displayed in pgadmin?<br />Those messages clutter my functionsoutput with information I dont need so I would like to get rid of them.<br /><br />Is that possible?<br /><br />Thanks,<br />Fernando.<br />
I'd like to know the answer to this as well. I don't think it is PgAdmin doing it, but the server .... On Mon, Apr 7, 2008 at 8:55 PM, Fernando Hevia <fhevia@gmail.com> wrote: > Hi list, > > How do I remove CONTEXT messages from being displayed in pgadmin? > Those messages clutter my functions output with information I dont need so I > would like to get rid of them. > > Is that possible? > > Thanks, > Fernando. >
On Mon, Apr 7, 2008 at 8:55 PM, Fernando Hevia <fhevia@gmail.com> wrote:
> Hi list,
>
> How do I remove CONTEXT messages from being displayed in pgadmin?
> Those messages clutter my functions output with information I dont need so I
> would like to get rid of them.
>
> Is that possible?
>
I found a previous post from Tom Lane stating that it is up to the client to have an option to suppress these messages. See: http://archives.postgresql.org/pgsql-admin/2008-02/msg00160.php
Actually psql has it with "set verbosity terse". I haven't found anything similar in pgAdmin though.
Any thoughts from the pgAdmin gurus out there?
Thanks,
Fernando.
> Hi list,
>
> How do I remove CONTEXT messages from being displayed in pgadmin?
> Those messages clutter my functions output with information I dont need so I
> would like to get rid of them.
>
> Is that possible?
>
On Mon, Apr 7, 2008 at 11:01 PM, Michael Shapiro <mshapiro51@gmail.com> wrote:
I'd like to know the answer to this as well. I don't think it is
PgAdmin doing it, but the server ....
I found a previous post from Tom Lane stating that it is up to the client to have an option to suppress these messages. See: http://archives.postgresql.org/pgsql-admin/2008-02/msg00160.php
Actually psql has it with "set verbosity terse". I haven't found anything similar in pgAdmin though.
Any thoughts from the pgAdmin gurus out there?
Thanks,
Fernando.
Fernando Hevia a écrit : > On Mon, Apr 7, 2008 at 8:55 PM, Fernando Hevia <fhevia@gmail.com > <mailto:fhevia@gmail.com>> wrote: > > Hi list, > > > > How do I remove CONTEXT messages from being displayed in pgadmin? > > Those messages clutter my functions output with information I dont > need so I > > would like to get rid of them. > > > > Is that possible? > > > On Mon, Apr 7, 2008 at 11:01 PM, Michael Shapiro <mshapiro51@gmail.com > <mailto:mshapiro51@gmail.com>> wrote: > > I'd like to know the answer to this as well. I don't think it is > PgAdmin doing it, but the server .... > > > I found a previous post from Tom Lane stating that it is up to the > client to have an option to suppress these messages. See: > http://archives.postgresql.org/pgsql-admin/2008-02/msg00160.php > Actually psql has it with "set verbosity terse". I haven't found > anything similar in pgAdmin though. > > Any thoughts from the pgAdmin gurus out there? > If it's on the query window, you can (probably) already do this with a : set log_error_verbosity to terse; Regards. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com
Hello. What do you mean saying CONTEXT messages? Could you give an example what you get and what you want to get from your functions? Fernando Hevia rašė: > Hi list, > > How do I remove CONTEXT messages from being displayed in pgadmin? > Those messages clutter my functions output with information I dont > need so I would like to get rid of them. > > Is that possible? > > Thanks, > Fernando. -- Julius Tuskenis
On Tue, Apr 8, 2008 at 3:29 AM, Julius Tuskenis <julius@nsoft.lt> wrote:
Hello.
What do you mean saying CONTEXT messages? Could you give an example what you get and what you want to get from your functions?
Sure. I have 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 immediately after the f_inner function logs.
The output I'm getting when executing f_outer is:
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
I want to get rid of the CONTEXT messages:
CONTEXT: SQL statement "SELECT f_inner( $1 )"
PL/pgSQL function "f_outer" line 9 at perform f_outer
--- 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;
Regards,
Fernando.
On Tue, Apr 8, 2008 at 3:22 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
Fernando Hevia a écrit :On Mon, Apr 7, 2008 at 8:55 PM, Fernando Hevia <fhevia@gmail.com <mailto:fhevia@gmail.com>> wrote:
> Hi list,
>
> How do I remove CONTEXT messages from being displayed in pgadmin?
> Those messages clutter my functions output with information I dont need so I
> would like to get rid of them.
>
> Is that possible?
>On Mon, Apr 7, 2008 at 11:01 PM, Michael Shapiro <mshapiro51@gmail.com <mailto:mshapiro51@gmail.com>> wrote:
I'd like to know the answer to this as well. I don't think it is
PgAdmin doing it, but the server ....
I found a previous post from Tom Lane stating that it is up to the client to have an option to suppress these messages. See: http://archives.postgresql.org/pgsql-admin/2008-02/msg00160.php
Actually psql has it with "set verbosity terse". I haven't found anything similar in pgAdmin though.
Any thoughts from the pgAdmin gurus out there?
If it's on the query window, you can (probably) already do this with a :
set log_error_verbosity to terse;
I have tried it previously but it doesn't help. For what I have been reading on the forums the log_error_verbosity affects only what goes to the server log file, it doesn't suppress messages sent to the client. Apparently it is up to the client to have the capability to suppress these messages so I am looking for a switch in pgAdmin itself.
Regards,
Fernando
On Apr 8, 3:01 pm, fhe...@gmail.com ("Fernando Hevia") wrote:
(...)
> --- 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;
Regardless of your request about silencing context messages (did not
look into that): maybe SQL along these lines would do the job for you?
select id_cliente, array_to_string(ARRAY(SELECT apellido from clientes
c0 WHERE c0.id_cliente = c.id_cliente), E'\n')
from clientes c
group by id_cliente
Regards
Erwin
Regardless of your request about silencing context messages (did not
look into that): maybe SQL along these lines would do the job for you?
select id_cliente, array_to_string(ARRAY(SELECT apellido from clientes
c0 WHERE c0.id_cliente = c.id_cliente), E'\n')
from clientes c
group by id_cliente
The functions where provided only as an example to reproduce the messages. Please disregard what they do. The actual functions on which I am working are much more complex and following the log output becomes quite cumbersome with those context messages.