Re: Removing Context Messages

From: Erwin Brandstetter <brsaweda(at)gmail(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: Re: Removing Context Messages
Date: 2008-04-08 16:36:41
Message-ID: 3e592836-e3ae-473e-9441-29c583d4d4d8@u10g2000prn.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Apr 8, 3:01 pm, fhe(dot)(dot)(dot)(at)gmail(dot)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

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Erwin Brandstetter 2008-04-08 16:51:40 Re: Grant RULE removed in pg 8.2
Previous Message Fernando Hevia 2008-04-08 13:08:27 Re: Removing Context Messages