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

Re: plperl error format vs plpgsql error format vs pgTAP

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kevin Field <kevinjamesfield(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: plperl error format vs plpgsql error format vs pgTAP
Date: 2009-05-29 17:04:04
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Kevin Field <kevinjamesfield(at)gmail(dot)com> writes:
> default:
> 				elog(ERROR, "unrecognized raise option: %d", opt->opt_type);

> Should this be changed to:

> default:
> 				ereport(ERROR, (errmsg_internal("unrecognized raise option: %d",
> opt->opt_type)));

No, we generally don't bother with that.  The above two are exactly
equivalent and the first is easier to write, so why complicate the code?
ereport is needed if you want to specify a SQLSTATE, provide a
translatable error message, etc, but for internal shouldn't-happen cases
we customarily just use elog.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2009-05-29 17:30:36
Subject: Re: explain analyze rows=%.0f
Previous:From: Aidan Van DykDate: 2009-05-29 17:03:05
Subject: Re: PostgreSQL Developer meeting minutes up

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