Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Pavel Cisar
Hi, Aggregate UDF's are nice, but I think it's a mistake to think about them only in classic COUNT(), AVG(), SUM() etc. context. Why we don't look at them in more general way? Aggregates loop over input set and produce single value. Right now we do UDF-like aggregates inside PSQL SP using

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Dimitry Sibiryakov
01.10.2018 11:24, Pavel Cisar wrote: Aggregates could produce various single-value outputs Why to limit them to single value? Some aggregates could profit if they are able to return more values at once. For example, avg + deviation. -- WBR, SD. Firebird-Devel mailing list, web

[Firebird-devel] [FB-Tracker] Created: (CORE-5932) Usage of "BLOB SUB_TYPE TEXT" for "free" parameters

2018-10-01 Thread Kovalenko Dmitry (JIRA)
Usage of "BLOB SUB_TYPE TEXT" for "free" parameters --- Key: CORE-5932 URL: http://tracker.firebirdsql.org/browse/CORE-5932 Project: Firebird Core Issue Type: Improvement Components:

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Simonov Denis via Firebird-devel
Dimitry Sibiryakov wrote Mon, 01 Oct 2018 12:44:58 +0300: 01.10.2018 11:24, Pavel Cisar wrote: Aggregates could produce various single-value outputs Why to limit them to single value? Some aggregates could profit if they are able to return more values at once. For example, avg +

[Firebird-devel] NULL and/or true/false

2018-10-01 Thread Kovalenko Dmitry
Hello, Firebird 3.0.4 Could anybody (Adriano?) confirm, that next result is corrected: select null or trueas c4__null_or_true, /* TRUE */ null or false as c5__null_or_false, /* NULL */ null and true as c6__null_and_true, /* NULL */ null and false as

[Firebird-devel] ODP: User-defined aggregate functions

2018-10-01 Thread Karol Bieniaszewski
Hi, I know that i am not Firebird core developer and I have less influence. But, why do you still say about WHILE, SUSSPEND, YIELD, FETCH if there is simple alternative to not have it at all? Can someone tell me what is wrong with my proposition?

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Dimitry Sibiryakov
01.10.2018 12:22, Simonov Denis via Firebird-devel wrote: Current SPs do not know how to aggregate data by an external cursor. To do this, you need to write queries inside the SP. How is this related to (in)ability to return several values at once? create aggregate function custom_avg (i

[Firebird-devel] [FB-Tracker] Created: (CORE-5933) incompatible RPM with CentOS 7

2018-10-01 Thread Joelp (JIRA)
incompatible RPM with CentOS 7 -- Key: CORE-5933 URL: http://tracker.firebirdsql.org/browse/CORE-5933 Project: Firebird Core Issue Type: Bug Affects Versions: 2.5.8 Environment: CentOS Linux release

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Simonov Denis via Firebird-devel
Dimitry Sibiryakov wrote Mon, 01 Oct 2018 13:28:44 +0300: 01.10.2018 12:22, Simonov Denis via Firebird-devel wrote: Current SPs do not know how to aggregate data by an external cursor. To do this, you need to write queries inside the SP. How is this related to (in)ability to return

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Alex Peshkoff via Firebird-devel
On 10/01/18 12:44, Dimitry Sibiryakov wrote: 01.10.2018 11:24, Pavel Cisar wrote: Aggregates could produce various single-value outputs   Why to limit them to single value? Some aggregates could profit if they are able to return more values at once. For example, avg + deviation. That

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Simonov Denis via Firebird-devel
Adriano dos Santos Fernandes wrote Sat, 29 Sep 2018 22:55:52 +0300: So SUSPEND in this context is very like JS YIELD with caller doing a reduce. I have even thought in use YIELD keyword in this context. Adriano The keyword YEILD is more preferable for aggregate functions. At the

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Adriano dos Santos Fernandes
On 01/10/2018 07:28, Dimitry Sibiryakov wrote: > 01.10.2018 12:22, Simonov Denis via Firebird-devel wrote: >> Current SPs do not know how to aggregate data by an external cursor. >> To do this, you need to write queries inside the SP. > >   How is this related to (in)ability to return several

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Dimitry Sibiryakov
01.10.2018 12:07, Simonov Denis via Firebird-devel wrote: To return more than one value you need support for ROW types. Otherwise, the function still does not extract more than one value. Current SP can return several values without any new type. -- WBR, SD. Firebird-Devel mailing

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Simonov Denis via Firebird-devel
Dimitry Sibiryakov wrote Mon, 01 Oct 2018 13:12:36 +0300: 01.10.2018 12:07, Simonov Denis via Firebird-devel wrote: To return more than one value you need support for ROW types. Otherwise, the function still does not extract more than one value. Current SP can return several values

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Dimitry Sibiryakov
01.10.2018 12:41, Adriano dos Santos Fernandes wrote: Saying that aggregate functions should return more than one data with a feature different than ROW type, is like saying our function (and any language's function) is broken. No thing is broken. ROW type is just a syntax sugar. But if you

Re: [Firebird-devel] NULL and/or true/false

2018-10-01 Thread Simonov Denis via Firebird-devel
Kovalenko Dmitry wrote Mon, 01 Oct 2018 19:18:23 +0300: Hello, Firebird 3.0.4 Could anybody (Adriano?) confirm, that next result is corrected: select null or trueas c4__null_or_true, /* TRUE */ null or false as c5__null_or_false, /* NULL */ null and true as

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Adriano dos Santos Fernandes
On 01/10/2018 09:46, Alex Peshkoff via Firebird-devel wrote: > On 10/01/18 12:44, Dimitry Sibiryakov wrote: >> 01.10.2018 11:24, Pavel Cisar wrote: >>> Aggregates could produce various single-value outputs >> >>   Why to limit them to single value? Some aggregates could profit if >> they are able

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Dimitry Sibiryakov
01.10.2018 15:35, Adriano dos Santos Fernandes wrote: A single (aggregate) function call should not produce (describe) more than one column in a query. Where is such limitation described except current codebase? -- WBR, SD. Firebird-Devel mailing list, web interface at

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Dimitry Sibiryakov
01.10.2018 16:27, Adriano dos Santos Fernandes wrote: Usage of FETCH seems good here, then I believe the production of rows would need a YIELD . Why to invent a new syntax instead of assignment + SUSPEND which everybody got used to? -- WBR, SD. Firebird-Devel mailing list, web

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Adriano dos Santos Fernandes
On 01/10/2018 10:49, Dimitry Sibiryakov wrote: > 01.10.2018 15:35, Adriano dos Santos Fernandes wrote: >> A single (aggregate) function call should not produce (describe) more >> than one column in a query. > >   Where is such limitation described except current codebase? > > avg_deviation(x) + 10

Re: [Firebird-devel] User-defined aggregate functions

2018-10-01 Thread Adriano dos Santos Fernandes
On 30/09/2018 06:25, Dimitry Sibiryakov wrote: > 30.09.2018 4:52, Adriano dos Santos Fernandes wrote: >> - Instead of agg_finished, adjust SUSPEND (probably with another >> keyword) to somehing like: SUSPEND WHEN FETCHED DO WHEN >> FINISHED DO > >   Isn't it how FETCH is used to be used: > >  

Re: [Firebird-devel] NULL and/or true/false

2018-10-01 Thread Mark Rotteveel
On 1-10-2018 18:18, Kovalenko Dmitry wrote: Hello, Firebird 3.0.4 Could anybody (Adriano?) confirm, that next result is corrected: select null   or true    as c4__null_or_true,  /*  TRUE */ null   or false   as c5__null_or_false,   /* NULL */ null   and true   as c6__null_and_true, /*

Re: [Firebird-devel] NULL and/or true/false

2018-10-01 Thread Kovalenko Dmitry
Hello Mark and Denis, >> Just – yes or no :) >Yes, and verified against SQL:2016. > Thank :) Dmitry Kovalenko Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel