Thread

Commits

  1. Fix misleading error message about inconsistent moving-aggregate types.

  1. 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
    
  2. 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