Re: poc - possibility to write window function in PL languages

2021-01-27 Thread Pavel Stehule
st 20. 1. 2021 v 21:14 odesílatel Pavel Stehule napsal: > > > st 20. 1. 2021 v 21:07 odesílatel Tom Lane napsal: > >> Pavel Stehule writes: >> > The second question is work with partition context value. This should be >> > only one value, and of only one but of any type per function. In this >>

Re: poc - possibility to write window function in PL languages

2021-01-20 Thread Pavel Stehule
st 20. 1. 2021 v 21:32 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > st 20. 1. 2021 v 21:07 odesílatel Tom Lane napsal: > >> Uh, what? I don't understand what this "partition context" is. > > > It was my name for an access to window partition local memory - > > WinGetPartitionLocalMe

Re: poc - possibility to write window function in PL languages

2021-01-20 Thread Tom Lane
Pavel Stehule writes: > st 20. 1. 2021 v 21:07 odesílatel Tom Lane napsal: >> Uh, what? I don't understand what this "partition context" is. > It was my name for an access to window partition local memory - > WinGetPartitionLocalMemory Ah. > We need some interface for this cache I'm not conv

Re: poc - possibility to write window function in PL languages

2021-01-20 Thread Pavel Stehule
st 20. 1. 2021 v 21:07 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > The second question is work with partition context value. This should be > > only one value, and of only one but of any type per function. In this > case > > we cannot use GET statements. I had an idea of enhancing de

Re: poc - possibility to write window function in PL languages

2021-01-20 Thread Tom Lane
Pavel Stehule writes: > The second question is work with partition context value. This should be > only one value, and of only one but of any type per function. In this case > we cannot use GET statements. I had an idea of enhancing declaration. Some > like > DECLARE > pcx PARTITION CONTEXT (in

Re: poc - possibility to write window function in PL languages

2021-01-20 Thread Pavel Stehule
Hi so 16. 1. 2021 v 0:09 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > [ plpgsql-window-functions-20210104.patch.gz ] > > I spent some time looking at this patch. It would certainly be > appealing to have some ability to write custom window functions > without descending into C; but

Re: poc - possibility to write window function in PL languages

2021-01-15 Thread Tom Lane
Pavel Stehule writes: > [ plpgsql-window-functions-20210104.patch.gz ] I spent some time looking at this patch. It would certainly be appealing to have some ability to write custom window functions without descending into C; but I'm not very happy about the details. I'm okay with the idea of ha

Re: poc - possibility to write window function in PL languages

2021-01-04 Thread Zhihong Yu
Hi, Pavel: Thanks for the update. I don't have other comment. Cheers On Mon, Jan 4, 2021 at 3:15 AM Pavel Stehule wrote: > Hi > > pá 1. 1. 2021 v 18:57 odesílatel Zhihong Yu napsal: > >> Hi, Pavel: >> Happy New Year. >> >> + command with clause WINDOW. The specific feature of >> + this fu

Re: poc - possibility to write window function in PL languages

2021-01-04 Thread Pavel Stehule
Hi pá 1. 1. 2021 v 18:57 odesílatel Zhihong Yu napsal: > Hi, Pavel: > Happy New Year. > > + command with clause WINDOW. The specific feature of > + this functions is a possibility to two special storages with > > this functions -> this function > > possibility to two special storages: there

Re: poc - possibility to write window function in PL languages

2021-01-01 Thread Zhihong Yu
Hi, Pavel: Happy New Year. + command with clause WINDOW. The specific feature of + this functions is a possibility to two special storages with this functions -> this function possibility to two special storages: there is no verb. 'store with stored one value': store is repeated. + * Porti

Re: poc - possibility to write window function in PL languages

2021-01-01 Thread Pavel Stehule
Hi rebase Regards Pavel diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index 11246aa653..89a07678ee 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -4606,6 +4606,99 @@ CREATE EVENT TRIGGER snitch ON ddl_command_start EXECUTE FUNCTION snitch();

Re: poc - possibility to write window function in PL languages

2020-08-28 Thread Pavel Stehule
pá 28. 8. 2020 v 8:14 odesílatel Pavel Stehule napsal: > > > st 26. 8. 2020 v 17:06 odesílatel Pavel Stehule > napsal: > >> Hi >> >> I simplified access to results of winfuncargs functions by proxy type >> "typedvalue". This type can hold any Datum value, and allows fast cast to >> basic buildi

Re: poc - possibility to write window function in PL languages

2020-08-27 Thread Pavel Stehule
st 26. 8. 2020 v 17:06 odesílatel Pavel Stehule napsal: > Hi > > I simplified access to results of winfuncargs functions by proxy type > "typedvalue". This type can hold any Datum value, and allows fast cast to > basic buildin types or it can use (slower) generic cast functions. It is > used in

Re: poc - possibility to write window function in PL languages

2020-08-26 Thread Pavel Stehule
Hi I simplified access to results of winfuncargs functions by proxy type "typedvalue". This type can hold any Datum value, and allows fast cast to basic buildin types or it can use (slower) generic cast functions. It is used in cooperation with a plpgsql assign statement that can choose the corre

poc - possibility to write window function in PL languages

2020-08-24 Thread Pavel Stehule
Hi I wrote a proof concept for the support window function from plpgsql. Window function API - functions named WinFuncArg* are polymorphic and it is not easy to wrap these functions for usage from SQL level. I wrote an enhancement of the GET statement - for this case GET WINDOW_CONTEXT, that allo