Re: Sample of user-define window function and other things

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Sample of user-define window function and other things
Date: 2009-01-12 14:42:37
Message-ID: 29645.1231771357@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> Even if they can support it shouldn't they reject functions that aren't
> actually window functions? What happens if you mark a perfectly normal
> function as a window function, does it behave sanely?

Yes, for small values of "sane". It will see all its arguments as NULL
(and will get called even if it was marked STRICT). Whatever it returns
under those circumstances is what the result will be.

I do not offhand see a reasonable interpretation for the combination of
WINDOW and STRICT attributes, so perhaps it'd be sensible for CREATE
FUNCTION to throw an error for that.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bernd Helmle 2009-01-12 14:49:36 Re: WIP: Automatic view update rules
Previous Message Simon Riggs 2009-01-12 14:36:43 Re: Recovery Test Framework