Re: Removing Context Messages - Mailing list pgadmin-support

From Erwin Brandstetter
Subject Re: Removing Context Messages
Date
Msg-id 3e592836-e3ae-473e-9441-29c583d4d4d8@u10g2000prn.googlegroups.com
Whole thread Raw
In response to Removing Context Messages  ("Fernando Hevia" <fhevia@gmail.com>)
Responses Re: Removing Context Messages
List pgadmin-support
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


pgadmin-support by date:

Previous
From: Erwin Brandstetter
Date:
Subject: Re: Grant RULE removed in pg 8.2
Next
From: "Fernando Hevia"
Date:
Subject: Re: Removing Context Messages