Re: aggregate function for median calculation - Mailing list pgsql-general

From Tom Lane
Subject Re: aggregate function for median calculation
Date
Msg-id 17112.993142044@sss.pgh.pa.us
Whole thread Raw
In response to Re: aggregate function for median calculation  ("Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>)
List pgsql-general
"Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu> writes:
> I worked on it so the struct state now has 3 fields: int length, int
> elem_count, int *elements. Now the issue is that the transition
> function, which I declare as strict, has a different input and state
> type (int4 and text respectively), so it requires an INITCOND. What
> should that be?

You're going to have to make your code able to start from a value that
can be represented as an INITCOND.  Say, an empty string (zero length
word and nothing else).  You're cheating, remember?

            regards, tom lane

pgsql-general by date:

Previous
From: "Thalis A. Kalfigopoulos"
Date:
Subject: Re: aggregate function for median calculation
Next
From: "Stock, Stuart H."
Date:
Subject: Error: cannot write block XX of XXXXX/XXXXX blind: resource tempo rarily unavailable