Petr Jelinek wrote: > On 2015-07-13 15:39, Tom Lane wrote: > >I don't find this to be good error message style. The secondary comment > >is not a "hint", it's an ironclad statement of what you did wrong, so if > >we wanted to phrase it like this it should be an errdetail not errhint. > >But the whole thing is overly cute anyway because there is no reason at > >all not to just say what we mean in the primary error message, eg > > ereport(ERROR, > > (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), > > errmsg("sample size must be greater than zero"))); > > Same as above, although now that I re-read the standard I am sure I > misunderstand it the first time - it says: > "If S is the null value or if S < 0 (zero) or if S > 100, then an exception > condition is raised: data exception — invalid sample size." > I took it as literal error message originally but they just mean status code > by it.
Yes, must use a new errcode ERRCODE_INVALID_SAMPLE_SIZE defined to 2202H here. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers