Skip site navigation (1) Skip section navigation (2)

raise statement, how to do multi-line message

From: Leon Starr <leon_starr(at)modelint(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: raise statement, how to do multi-line message
Date: 2011-02-06 06:09:36
Message-ID: A079CFC3-A935-43D5-A4E1-69C140047444@modelint.com (view raw or flat)
Thread:
Lists: pgsql-novice
Most of my raise statements use short format strings, but every now and then I get a long one that
wraps around in my code and looks ugly.  Example:

raise exception 'Delivery specification for Monitored Event [%:%:%] and Notification Template [%] does not exist.',
	p_event, p_monitor, p_subscriber, p_template;

Also, assume that I've got this indented a few levels, so that he format string wraps in my code.

Is there any way to break the format string into multiple lines in my code, but still
have a single line message (no line breaks) appear on the console?

I tried this, but it didn't work:

raise exception 'Delivery specification for Monitored Event' || '[%:%:%] and Notification Template [%] does not exist.',
	p_event, p_monitor, p_subscriber, p_template;

It's not that big of a deal, but maybe there's a cool trick I need to learn...

- Leon

Responses

pgsql-novice by date

Next:From: LewDate: 2011-02-06 17:53:20
Subject: Re: Backing up several PostgreSQL databases
Previous:From: Rolando EdwardsDate: 2011-02-05 22:12:45
Subject: Re: Backing up several PostgreSQL databases

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group