RE: [SQL] Display message to user

From: "Bart van Houdt" <bart(dot)van(dot)houdt(at)syfact(dot)com>
To: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>, <pgsql-sql(at)postgresql(dot)org>
Subject: RE: [SQL] Display message to user
Date: 2008-11-04 14:08:57
Message-ID: CECE69D480C32F49891F27ED3E49C38C04828483@nthvsexch02.interaccess.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello Fernando,

Thank you for the quick response.

When setting the parameter, the output changed to:

psql:d:/tmp/pg/migrate.sql:4: NOTICE: Joehoeeee!

write_line

------------

(1 row)

Which looks a lot better already! And you have given me new hope and a new angle to look at :)

Regards,

Bart van Houdt

Syfact International B.V.

Database developer

From: Fernando Hevia [mailto:fhevia(at)ip-tel(dot)com(dot)ar]
Sent: dinsdag 4 november 2008 14:25
To: Bart van Houdt; pgsql-sql(at)postgresql(dot)org
Subject: RE: [SQL] Display message to user

Hi Bart,

If you are using psql then you can get rid of those messages by entering on the psql prompt:

\set verbose TERSE

If you are using pgAdmin, sadly there is currently no way for this application to filter context messages.

Regards,

Fernando


________________________________

De: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-owner(at)postgresql(dot)org] En nombre de Bart van Houdt
Enviado el: Martes, 04 de Noviembre de 2008 10:32
Para: pgsql-sql(at)postgresql(dot)org
Asunto: [SQL] Display message to user

Hi all,

I am a Postgres-newbie and working on porting our code from Oracle to Postgres.

Oracle has a nice package procedure (dbms_output.put_line) to display a message in SQL*Plus, which can display a message to the user. I use this a lot, to notify users of the progress being made during the execution of a script.

Is there a way to do this with Postgres as well?

I have tried using ‘RAISE NOTICE’, but using this some extra lines are printed on screen. Those extra lines mess up the screen and will confuse the users. The extra lines shown are:

CONTEXT: SQL statement "SELECT migration_pkg.time_migration( $1 , $2 )"

PL/pgSQL function "check_migration" line 34 at PERFORM

Any help would be appreciated,

Bart van Houdt

Syfact International B.V.

Database developer

Browse pgsql-sql by date

  From Date Subject
Next Message Devil™ Dhuvader 2008-11-04 15:38:58 need help in building a query
Previous Message Fernando Hevia 2008-11-04 13:24:52 Re: Display message to user