Re: Missing errcode() in ereport
Craig Ringer <craig@2ndquadrant.com>
From: Craig Ringer <craig@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Amit Kapila <amit.kapila16@gmail.com>, Michael Paquier <michael@paquier.xyz>, Julien Rouhaud <rjuju123@gmail.com>, Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-03-30T03:54:03Z
Lists: pgsql-hackers
On Fri, 20 Mar 2020, 01:59 Andres Freund, <andres@anarazel.de> wrote: > Hi, > > On 2020-03-17 10:09:18 -0400, Tom Lane wrote: > > We might want to spend some effort thinking how to find or prevent > > additional bugs of the same ilk ... > > Yea, that'd be good. Trying to help people new to postgres write their > first patches I found that ereport is very confusing to them - largely > because the syntax doesn't make much sense. Made worse by the compiler > error messages being terrible in many cases. Very much agreed. I'd have found it helpful to just have the docs explain clearly how it works by chaining the comma operator using functions with ignored return values. That would also help people understand how they can make parts of an ereport conditional, e.g. only set errdetail() if there additional info is currently available W/O duplicating the rest of the ereport . Not sure there's much we can do without changing ereport's "signature" > though :( > > Regards, > > Andres > > >
Commits
-
Go back to returning int from ereport auxiliary functions.
- bda6dedbea59 13.0 landed
-
Improve the internal implementation of ereport().
- 17a28b03645e 13.0 landed
-
Re-implement the ereport() macro using __VA_ARGS__.
- e3a87b4991cc 13.0 landed
- a86715451653 12.3 landed
-
Add missing errcode() in a few ereport calls.
- 6bdfe428d399 9.5.22 landed
- fe27ce1c136d 9.6.18 landed
- 569f9354bb43 10.13 landed
- 18c41cb6b714 11.8 landed
- e37824136f06 12.3 landed
- b4f140869f5d 13.0 landed