Tom Lane writes:
> I recommend adding a configure test to see whether sys_nerr exists,
> and trusting strerror() to be bulletproof only where it does not.
>
> As you say, there could be holes in the error number assignment,
> so an additional test for NULL result from strerror() seems wise.
Definitely a good plan. If someone wants to be really dilligent he could
write up a "pgstrerror", which
1. does the str_nerr check if it exists
2. runs strerror(errno)
3. checks for NULL or EINVAL
4. returns something useful
You put that into src/utils and link it into every program or library that
uses strerror.
Any reasonable subset of this solution would be fine as well. :)
--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/