"Hitoshi Harada" <umi.tanuki@gmail.com> writes:
> 2008/12/29 Tom Lane <tgl@sss.pgh.pa.us>:
>> * Support creation of user-defined window functions. I think this is
>> a "must have" for 8.4 --- we are not in the habit of building
>> nonextensible basic features. It doesn't seem that hard either.
> The reason I and people decided window functions are not able to be
> defined by user is whether Window functions API is ready for exposure.
Well, it seems about as stable as any other bit of new backend code ;-).
We never promise that backend-internal APIs will not change across
versions.
> My only concern is for plpgsql. For c functions we can define user
> functions but what about other pls?
I'm not concerned about making this stuff available at the PL level
(at least not yet). C-level capability will be enough to satisfy
my concern for 8.4.
> And surveying sgml docs, I found this is not correct.
> http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/select.sgml?r1=1.112&r2=1.113
> + default framing behavior, which is equivalent to the framing clause
> + <literal>ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW</>.
> the default frame with ORDER BY clause is RANGE BETWEEN UNBOUNDED
> PRECEDING AND CURRENT ROW, as aggregates perform rows peer to the
> current row.
What is the difference? AFAICS the RANGE and ROWS keywords ought to be
equivalent if you are not specifying "expression PRECEDING" or
"expression FOLLOWING".
regards, tom lane