Обсуждение: Removing Context Messages

Поиск
Список
Период
Сортировка

Removing Context Messages

От
"Fernando Hevia"
Дата:
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 /> 

Re: Removing Context Messages

От
"Michael Shapiro"
Дата:
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.
>


Re: Removing Context Messages

От
"Fernando Hevia"
Дата:
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?
>
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.


Re: Removing Context Messages

От
Guillaume Lelarge
Дата:
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


Re: Removing Context Messages

От
Julius Tuskenis
Дата:
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




Re: Removing Context Messages

От
"Fernando Hevia"
Дата:
<br /><div class="gmail_quote">On Tue, Apr 8, 2008 at 3:29 AM, Julius Tuskenis <<a
href="mailto:julius@nsoft.lt">julius@nsoft.lt</a>>wrote:<br /><blockquote class="gmail_quote" style="border-left:
1pxsolid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hello.<br /><br /> What do you mean saying
CONTEXTmessages? Could you give an example what you get and what you want to get from your functions?<br /><br /><br
/></blockquote></div><br/>Sure. I have made a simple example to show this with 2 functions: f_outer which loops through
arecordset and calls f_inner for each record.<br /> <br />Context messages appear immediately after the f_inner
functionlogs.<br /> The output I'm getting when executing f_outer is:<br /> <br />NOTICE:  f_outer: 3<br />NOTICE: 
f_inner:3 = [HEVIA]<br />CONTEXT:  SQL statement "SELECT  f_inner( $1 )"<br />PL/pgSQL function "f_outer" line 9 at
perform<br/> NOTICE:  f_outer: 6<br />NOTICE:  f_inner: 6 = [GUIDARA]<br />CONTEXT:  SQL statement "SELECT  f_inner( $1
)"<br/>PL/pgSQL function "f_outer" line 9 at perform<br />NOTICE:  f_outer: 7<br />NOTICE:  f_inner: 7 =
[MASTROIANI]<br/> CONTEXT:  SQL statement "SELECT  f_inner( $1 )"<br />PL/pgSQL function "f_outer" line 9 at perform 
f_outer<br/><br /><br />I want to get rid of the CONTEXT messages:<br />  CONTEXT:  SQL statement "SELECT  f_inner( $1
)"<br/>   PL/pgSQL function "f_outer" line 9 at perform  f_outer<br /><br /> <br />--- Function declaration follows in
caseit helps --- <br />CREATE OR REPLACE FUNCTION f_inner(p_client numeric(10)) RETURNS void AS $BODY$ <br />
DECLARE<br/>  r_clients clientes%ROWTYPE;<br />BEGIN<br />  SELECT * INTO r_clients FROM clientes WHERE id_cliente =
p_client;<br/>  RAISE NOTICE 'f_inner: % = [%]', p_client, r_clients.apellido; <br />END; <br />$BODY$ <br /> LANGUAGE
'plpgsql'VOLATILE;<br /> <br />CREATE OR REPLACE FUNCTION f_outer() RETURNS void AS <br />$BODY$ <br />DECLARE<br /> 
r_clientsclientes%ROWTYPE;<br />BEGIN<br />  FOR r_clients IN SELECT * FROM CLIENTES<br />  LOOP<br />     RAISE NOTICE
'f_outer:%', r_clients.id_cliente;<br />    PERFORM f_inner(r_clients.id_cliente);<br />  END LOOP;<br />END;<br
/>$BODY$<br/>LANGUAGE 'plpgsql' VOLATILE;<br /><br />Regards,<br />Fernando.<br /> 

Re: Removing Context Messages

От
"Fernando Hevia"
Дата:
<br /><div class="gmail_quote">On Tue, Apr 8, 2008 at 3:22 AM, Guillaume Lelarge <<a
href="mailto:guillaume@lelarge.info">guillaume@lelarge.info</a>>wrote:<br /><blockquote class="gmail_quote"
style="border-left:1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Fernando Hevia a écrit
:<br/><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div
class="Ih2E3d">On Mon, Apr 7, 2008 at 8:55 PM, Fernando Hevia <<a href="mailto:fhevia@gmail.com"
target="_blank">fhevia@gmail.com</a><mailto:<a href="mailto:fhevia@gmail.com"
target="_blank">fhevia@gmail.com</a>>>wrote:<br />  > Hi list,<br />  ><br />  > How do I remove CONTEXT
messagesfrom being displayed in pgadmin?<br />  > Those messages clutter my functions output with information I dont
needso I<br />  > would like to get rid of them.<br />  ><br />  > Is that possible?<br />  ><br
/></div><divclass="Ih2E3d"> On Mon, Apr 7, 2008 at 11:01 PM, Michael Shapiro <<a href="mailto:mshapiro51@gmail.com"
target="_blank">mshapiro51@gmail.com</a><mailto:<a href="mailto:mshapiro51@gmail.com"
target="_blank">mshapiro51@gmail.com</a>>>wrote:<br /><br />    I'd like to know the answer to this as well. I
don'tthink it is<br />    PgAdmin doing it, but the server ....<br /><br /><br /> I found a previous post from Tom Lane
statingthat it is up to the client to have an option to suppress these messages. See: <a
href="http://archives.postgresql.org/pgsql-admin/2008-02/msg00160.php"
target="_blank">http://archives.postgresql.org/pgsql-admin/2008-02/msg00160.php</a><br/> Actually psql has it with "set
verbosityterse". I haven't found anything similar in pgAdmin though.<br /><br /> Any thoughts from the pgAdmin gurus
outthere?<br /><br /></div></blockquote><br /> If it's on the query window, you can (probably) already do this with a
:<br/><br />  set log_error_verbosity to terse;<br /><br /></blockquote></div><br />I have tried it previously but it
doesn'thelp. For what I have been reading on the forums the log_error_verbosity affects only what goes to the server
logfile, it doesn't suppress messages sent to the client. Apparently it is up to the client to have the capability to
suppressthese messages so I am looking for a switch in pgAdmin itself.<br /><br />Regards,<br />Fernando<br /><br /> 

Re: Removing Context Messages

От
Erwin Brandstetter
Дата:
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


Re: Removing Context Messages

От
"Fernando Hevia"
Дата:
<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt
0pt0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br /></div>Regardless of your request about silencing context
messages(did not<br /> look into that): maybe SQL along these lines would do the job for you?<br /><br /> select
id_cliente,array_to_string(ARRAY(SELECT apellido from clientes<br /> c0 WHERE c0.id_cliente = c.id_cliente), E'\n')<br
/>from clientes c<br /> group by id_cliente<br /><br /><br /></blockquote></div><br />The functions where provided only
asan example to reproduce the messages. Please disregard what they do. The actual functions on which I am working are
muchmore complex and following the log output becomes quite cumbersome with those context messages.<br />