Re: Combination of ordered-set aggregate function terminates JDBC connection on PostgreSQL 9.6.5
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Lukas Eder <lukas.eder@gmail.com>,
PostgreSQL mailing lists <pgsql-bugs@postgresql.org>,
Heikki Linnakangas <hlinnaka@iki.fi>
Date: 2017-10-14T20:51:32Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Treat aggregate direct arguments as per-agg data not per-trans data.
- cf5ba7c30c04 11.0 landed
-
Allow the built-in ordered-set aggregates to share transition state.
- be0ebb65f512 11.0 landed
-
Fix AggGetAggref() so it won't lie to aggregate final functions.
- 305cf1fd7239 11.0 landed
- d48bf6a94d29 10.1 landed
- aa1e9b3a4661 9.6.6 landed
-
Prevent sharing transition states between ordered-set aggregates.
- 52328727bea4 11.0 landed
- 96cfc7e19ae1 9.6.6 landed
- 604723d29a86 10.1 landed
Attachments
- allow-state-merging-in-builtin-OSAs.patch (text/x-diff) patch
I wrote: > To know what value of randomAccess to pass to the tuplesort setup, > we have to know *at the first transition-function call* whether > there may be multiple final-function calls coming up. So what > what I'm imagining is a simple boolean result "yes, there will be > only one finalfn call, so it can destructively modify the transition > state", or "there might be more than one finalfn call, so the finalfn(s) > must preserve transition state". And this info has to be available > throughout the aggregate run. Attached is a proposed patch to make the ordered-set aggregates safe for state merging. I've not tested it really thoroughly, but it passes the regression cases added in 52328727b. regards, tom lane