Group: pgsql.hackers


Subject: unclear enum error messages
From: tgl@sss.pgh.pa.us (Tom Lane)
Date: 11/28/2007 11:01:26 AM
Peter Eisentraut <peter_e@gmx.net> writes: > There are a few error messages like this in the code: > /* > * We rely on being able to get the specific enum type from the calling > * expression tree. The generic type mechanism should have ensured that > * both are of the same type. > */ > enumtypoid = get_fn_expr_argtype(fcinfo->flinfo, 0); > if (enumtypoid == InvalidOid) > ereport(ERROR, > (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), > errmsg("could not determine actual enum type"))); > First, isn't this an internal error? Not necessarily; there are many code paths by which a function could get called without argument-type info. Thus the FEATURE_NOT_SUPPORTED classification. > What is an actual enum type? And how should a user react if he got this > message? I would ask, "why not?". Yeah, I would too, but without a concrete example to look at it's hard to say if the situation could be improved. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly

Subject: unclear enum error messages
From: tgl@sss.pgh.pa.us (Tom Lane)
Date: 11/29/2007 12:32:18 AM
"Tom Dunstan" <pgsql@tomd.cc> writes: > I wouldn't get too worried, though. These are defensive error messages > that are really just checking for sane input, and they seem difficult > to deliberately trip, let alone accidentally, so stressing about them > is probably unnecessary. Right. I'm not really expecting to see that message fire; it's just there to ensure sane behavior if it does happen. Peter might be right that an elog instead of ereport would be sufficient. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq