pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedA PL/PgSQL Question
2+ messages / 2 participants
[nested] [flat]
* A PL/PgSQL Question
@ 2002-12-13 17:50 Ludwig Lim <lud_nowhere_man@yahoo.com>
0 siblings, 1 reply; 2+ messages in thread
From: Ludwig Lim @ 2002-12-13 17:50 UTC (permalink / raw)
To: pgsql-sql
Hi:
I have the following PL/PgSQL code blocks:
a) IF (condition) THEN
RAISE EXCEPTION ''Cannot Insert'';
END IF;
b) IF (condition) THEN
RAISE NOTICE ''Cannot Insert'';
RETURN NULL;
END IF;
What is the difference between the first and second
chunk PL/PgSQL INSERT/UPDATE trigger function code
aside from the fact that first scenario will result in
an "ABORT" state?
Are there any instances where a NOTICE and a RETURN
NULL statement is a much better than a RAISE EXCEPTION
statement?
Thank you very much,
ludwig lim
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: A PL/PgSQL Question
@ 2002-12-13 19:41 Josh Berkus <josh@agliodbs.com>
parent: Ludwig Lim <lud_nowhere_man@yahoo.com>
0 siblings, 0 replies; 2+ messages in thread
From: Josh Berkus @ 2002-12-13 19:41 UTC (permalink / raw)
To: Ludwig Lim <lud_nowhere_man@yahoo.com>; pgsql-sql
Ludwig,
> What is the difference between the first and second
> chunk PL/PgSQL INSERT/UPDATE trigger function code
> aside from the fact that first scenario will result in
> an "ABORT" state?
>
> Are there any instances where a NOTICE and a RETURN
> NULL statement is a much better than a RAISE EXCEPTION
> statement?
Not that I have encountered, but YMMV.
--
-Josh Berkus
Aglio Database Solutions
San Francisco
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2002-12-13 19:41 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-12-13 17:50 A PL/PgSQL Question Ludwig Lim <lud_nowhere_man@yahoo.com>
2002-12-13 19:41 ` Josh Berkus <josh@agliodbs.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox