Thread: PATCH: Window Function support for PostgreSQL 8.4

PATCH: Window Function support for PostgreSQL 8.4

From
Ashesh Vashi
Date:
Hi All,

I have been working on support for WINDOW function in PostgreSQL 8.4.

Please find the patch for it.

Problem definition:
- Add an entry to the property list to indicate whether or not a
function is a window function.
- Modify the reverse engineered SQL to include the WINDOW keyword
where appropriate.
- Modify the function dialogue to allow the user to create window
functions (adding a checkbox seems the sensible way, which becomes
read-only in edit mode).
- For window functions, supported language will be 'c' only.

New function syntax can be found at:
http://developer.postgresql.org/pgdocs/postgres/sql-createfunction.html

As I asked a suggestion on utilizing the space while using boolean
parameters, Dave Page has suggested to use wxCheckListBox, but it has
limitation of "Not able to disable particular checkbox in that list."

I come up with a simple solution:
Put all the boolean parameters together and instead of putting them in
each row, kept them in 2x2 table. It does not look that so decent. :(
But, we can use this approach, until we come up with any good solution
for that.

--
Regards,
Ashesh Vashi

EnterpriseDB INDIA: http://www.enterprisedb.com

Re: PATCH: Window Function support for PostgreSQL 8.4

From
"Dave Page"
Date:
On Mon, Jan 12, 2009 at 8:56 AM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
> Hi All,
>
> I have been working on support for WINDOW function in PostgreSQL 8.4.
>
> Please find the patch for it.

Thanks Ashesh. Patch applied with a few minor changes:

- The dialogue really didn't look good with the grid of checkboxes, so
I've split the properties tab into two, one for basic properties and
one for 'options'. It looks much better I think.

- It's not up to us (or even the backend) to decide what languages can
be used to make window functions. Currently it's only C, but that may
change. It makes more sense for the language validators to throw an
error if needed, as noted by Peter Eisentraut on pgsql-hackers justa
few minutes ago.

- Added 'window' as a keyword soit's quoted and highlighted in the STC
as required.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com