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

Re: Raise Notice

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Prasad dev <esteem3300(at)hotmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Raise Notice
Date: 2005-06-23 01:37:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Wed, Jun 22, 2005 at 11:49:59PM +0000, Prasad dev wrote:
> Basically i am dealing with triggers which addresses referential integrity, 

Are you familiar with foreign key constraints?  PostgreSQL can
automatically do referential integrity checks for you.

(Links are to the 7.3 documentation because you said you were running
that version.)

> SO in the end what i look for is a proper message instead of "DELETE 0".

You could do this in application code, or you could wrap the delete
in a function that checks how many rows were deleted and raises a
notice if the count was zero.

If you were using 7.4 or later, you could use a statement-level
AFTER trigger to raise a notice if no rows were deleted.  But it's
still not clear what value such a notice would add.

> by the way what do you mean by dont post in HTML ?

Your previous messages were HTML-formatted.  Some people use
text-based mail readers, so they have to take extra steps to convert
the HTML to something legible; also, some people's spam filters
might automatically delete HTML messages.  Plain text is more likely
to be acceptable to some people.

Michael Fuhr

In response to

pgsql-novice by date

Next:From: Keith WorthingtonDate: 2005-06-23 02:55:07
Subject: Search function
Previous:From: Prasad devDate: 2005-06-22 23:49:59
Subject: Re: Raise Notice

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