Thread
Commits
-
Fix misleading error message about inconsistent moving-aggregate types.
- e0b4c7dd0b61 9.5.24 landed
- 2939f613fa91 9.6.20 landed
- f71b93b8646b 10.15 landed
- baef6e5e9397 11.10 landed
- f45dd3fed9cf 12.5 landed
- f04203ab7e68 13.0 landed
- 19ad7e1d7b8b 14.0 landed
-
moving aggregate bad error message
Jeff Janes <jeff.janes@gmail.com> — 2020-09-06T16:07:16Z
I was wondering if I could just add minvfunc, and have the rest of the m* functions be assumed to be the same as their non-moving counterparts. Apparently the answer is 'no'. But in the process, I found a bad error message. When omitting mfinalfunc when there is a finalfunc, I get the error: "ERROR: moving-aggregate implementation returns type jj_state, but plain implementation returns type jj_state." A rather peculiar complaint, analogous to the infamous "something failed: Success". Looking at the code, it seems we are testing rettype != finaltype, but reporting aggmTransType and aggTransType. Why aren't we reporting what we are testing? With the attached patch, it gives the more sensible "ERROR: moving-aggregate implementation returns type jj_state, but plain implementation returns type numeric." Cheers, Jeff
-
Re: moving aggregate bad error message
Tom Lane <tgl@sss.pgh.pa.us> — 2020-09-06T16:41:41Z
Jeff Janes <jeff.janes@gmail.com> writes: > Looking at the code, it seems we are testing rettype != finaltype, but > reporting aggmTransType and aggTransType. Why aren't we reporting what we > are testing? Silly thinko, apparently. Your fix looks right, will push. regards, tom lane