Re: [HACKERS] count_nulls(VARIADIC "any")

2016-02-08 Thread Thomas Munro
On Tue, Feb 9, 2016 at 9:26 AM, Tom Lane wrote: > Thomas Munro writes: >> Would num_values be a better name than num_nonnulls? > > If "value" is a term that excludes null values, it's news to me. Ah, right, I was thinking of null as the absence of a value. But in fact it is a special value that

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-02-08 Thread Tom Lane
Thomas Munro writes: > Would num_values be a better name than num_nonnulls? If "value" is a term that excludes null values, it's news to me. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: ht

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-02-08 Thread Thomas Munro
On Fri, Feb 5, 2016 at 5:06 PM, Tom Lane wrote: > I wrote: >> Pavel Stehule writes: >>> [ num_nulls_v6.patch ] > >> I started looking through this. It seems generally okay, but I'm not >> very pleased with the function name "num_notnulls". I think it would >> be better as "num_nonnulls", as I s

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-02-05 Thread Marko Tiikkaja
On 2016-02-05 05:06, Tom Lane wrote: I wrote: Pavel Stehule writes: [ num_nulls_v6.patch ] I started looking through this. It seems generally okay, but I'm not very pleased with the function name "num_notnulls". I think it would be better as "num_nonnulls", as I see Oleksandr suggested al

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-02-04 Thread Pavel Stehule
Dne 5. 2. 2016 1:33 napsal uživatel "Tom Lane" : > > Pavel Stehule writes: > > [ num_nulls_v6.patch ] > > I started looking through this. It seems generally okay, but I'm not > very pleased with the function name "num_notnulls". I think it would > be better as "num_nonnulls", as I see Oleksandr

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-02-04 Thread Tom Lane
I wrote: > Pavel Stehule writes: >> [ num_nulls_v6.patch ] > I started looking through this. It seems generally okay, but I'm not > very pleased with the function name "num_notnulls". I think it would > be better as "num_nonnulls", as I see Oleksandr suggested already. Not hearing any complain

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-02-04 Thread Tom Lane
Pavel Stehule writes: > [ num_nulls_v6.patch ] I started looking through this. It seems generally okay, but I'm not very pleased with the function name "num_notnulls". I think it would be better as "num_nonnulls", as I see Oleksandr suggested already. regards, tom lane

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-26 Thread Pavel Stehule
2016-01-26 11:42 GMT+01:00 Marko Tiikkaja : > On 25/01/16 19:57, Pavel Stehule wrote: > >> Marco is a author of this patch, so - Marco, please, send final version of >> this patch >> > > I don't really care about the tests. Can we not use the v5 patch already > in the thread? As far as I could t

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-26 Thread Marko Tiikkaja
On 25/01/16 19:57, Pavel Stehule wrote: Marco is a author of this patch, so - Marco, please, send final version of this patch I don't really care about the tests. Can we not use the v5 patch already in the thread? As far as I could tell there were no reviewer's comments on it anymore. .m

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-25 Thread Pavel Stehule
2016-01-22 13:34 GMT+01:00 Jim Nasby : > On 1/21/16 1:48 PM, Pavel Stehule wrote: > >> the form of regress tests is not pretty significant issue. Jim's >> design is little bit transparent, Marko's is maybe little bit >> practical. Both has sense from my opinion, and any hasn't >> s

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-22 Thread Jim Nasby
On 1/21/16 1:48 PM, Pavel Stehule wrote: the form of regress tests is not pretty significant issue. Jim's design is little bit transparent, Marko's is maybe little bit practical. Both has sense from my opinion, and any hasn't significant advantage against other. any possible agr

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-21 Thread Pavel Stehule
Hi 2016-01-17 8:43 GMT+01:00 Pavel Stehule : > > > 2016-01-12 17:27 GMT+01:00 Marko Tiikkaja : > >> On 03/01/16 22:49, Jim Nasby wrote: >> >>> In the unit test, I'd personally prefer just building a table with the >>> test cases and the expected NULL/NOT NULL results, at least for all the >>> cal

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-16 Thread Pavel Stehule
2016-01-12 17:27 GMT+01:00 Marko Tiikkaja : > On 03/01/16 22:49, Jim Nasby wrote: > >> In the unit test, I'd personally prefer just building a table with the >> test cases and the expected NULL/NOT NULL results, at least for all the >> calls that would fit that paradigm. That should significantly

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-12 Thread Marko Tiikkaja
On 03/01/16 22:49, Jim Nasby wrote: In the unit test, I'd personally prefer just building a table with the test cases and the expected NULL/NOT NULL results, at least for all the calls that would fit that paradigm. That should significantly reduce the size of the test. Not a huge deal though...

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-04 Thread Pavel Stehule
Hi 2016-01-04 5:49 GMT+01:00 Jim Nasby : > On 1/3/16 10:23 PM, Pavel Stehule wrote: > >> Hi >> >> 2016-01-03 22:49 GMT+01:00 Jim Nasby > >: >> >> On 1/3/16 2:37 PM, Pavel Stehule wrote: >> >> + /* num_nulls(VARIADIC NULL) is defined as NU

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-03 Thread Jim Nasby
On 1/3/16 10:23 PM, Pavel Stehule wrote: Hi 2016-01-03 22:49 GMT+01:00 Jim Nasby mailto:jim.na...@bluetreble.com>>: On 1/3/16 2:37 PM, Pavel Stehule wrote: + /* num_nulls(VARIADIC NULL) is defined as NULL */ + if (PG_ARGISNULL(0)) +

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-03 Thread Pavel Stehule
Hi 2016-01-03 22:49 GMT+01:00 Jim Nasby : > On 1/3/16 2:37 PM, Pavel Stehule wrote: > >> + /* num_nulls(VARIADIC NULL) is defined as NULL */ >> + if (PG_ARGISNULL(0)) >> + return false; >> > > Could you add to the comment explaining why that's the

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-03 Thread Jim Nasby
On 1/3/16 2:37 PM, Pavel Stehule wrote: + /* num_nulls(VARIADIC NULL) is defined as NULL */ + if (PG_ARGISNULL(0)) + return false; Could you add to the comment explaining why that's the desired behavior? + /* +* N

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-03 Thread Pavel Stehule
2016-01-03 21:37 GMT+01:00 Pavel Stehule : > Hi > > > 2015-08-12 19:18 GMT+02:00 Marko Tiikkaja : > >> Hi, >> >> I'd like to suggest $SUBJECT for inclusion in Postgres 9.6. I'm sure >> everyone would've found it useful at some point in their lives, and the >> fact that it can't be properly implem

Re: [HACKERS] count_nulls(VARIADIC "any")

2016-01-03 Thread Pavel Stehule
Hi 2015-08-12 19:18 GMT+02:00 Marko Tiikkaja : > Hi, > > I'd like to suggest $SUBJECT for inclusion in Postgres 9.6. I'm sure > everyone would've found it useful at some point in their lives, and the > fact that it can't be properly implemented in any language other than C I > think speaks for t

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-22 Thread Marko Tiikkaja
On 2015-11-22 21:17, Jim Nasby wrote: On 11/22/15 11:34 AM, Marko Tiikkaja wrote: On 2015-11-22 18:29, Jim Nasby wrote: Only if you know how many columns there already are. Or does this not work if you hand it a row? It "works" in the sense that it tells you whether the row is NULL or not.

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-22 Thread Jim Nasby
On 11/22/15 11:34 AM, Marko Tiikkaja wrote: On 2015-11-22 18:29, Jim Nasby wrote: Only if you know how many columns there already are. Or does this not work if you hand it a row? It "works" in the sense that it tells you whether the row is NULL or not. I.e. the answer will always be 0 or 1.

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-22 Thread Marko Tiikkaja
On 2015-11-22 18:29, Jim Nasby wrote: Only if you know how many columns there already are. Or does this not work if you hand it a row? It "works" in the sense that it tells you whether the row is NULL or not. I.e. the answer will always be 0 or 1. .m -- Sent via pgsql-hackers mailing li

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-22 Thread Jim Nasby
On 11/20/15 11:55 PM, Marko Tiikkaja wrote: On 2015-11-21 06:52, Jim Nasby wrote: On 11/20/15 11:12 PM, Marko Tiikkaja wrote: On 2015-11-21 06:02, I wrote: Here's a patch implementing this under the name num_nulls(). For January's CF, of course. I forgot to update the some references in the

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Marko Tiikkaja
On 2015-11-21 06:52, Jim Nasby wrote: On 11/20/15 11:12 PM, Marko Tiikkaja wrote: On 2015-11-21 06:02, I wrote: Here's a patch implementing this under the name num_nulls(). For January's CF, of course. I forgot to update the some references in the documentation. Fixed in v3, attached. I t

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Jim Nasby
On 11/20/15 11:12 PM, Marko Tiikkaja wrote: On 2015-11-21 06:02, I wrote: Here's a patch implementing this under the name num_nulls(). For January's CF, of course. I forgot to update the some references in the documentation. Fixed in v3, attached. I thought there was going to be a not-null

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Marko Tiikkaja
On 2015-11-21 06:02, I wrote: Here's a patch implementing this under the name num_nulls(). For January's CF, of course. I forgot to update the some references in the documentation. Fixed in v3, attached. .m *** a/doc/src/sgml/func.sgml --- b/doc/src/sgml/func.sgml *** *** 182,

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Marko Tiikkaja
On 2015-11-21 06:06, Tom Lane wrote: Marko Tiikkaja writes: Here's a patch implementing this under the name num_nulls(). For January's CF, of course. What's this do that "count(*) - count(x)" doesn't? This is sort of a lateral version of count(x); the input is a list of expressions rather

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Tom Lane
Marko Tiikkaja writes: > Here's a patch implementing this under the name num_nulls(). For > January's CF, of course. What's this do that "count(*) - count(x)" doesn't? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make cha

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Marko Tiikkaja
Hello, Here's a patch implementing this under the name num_nulls(). For January's CF, of course. .m *** a/doc/src/sgml/func.sgml --- b/doc/src/sgml/func.sgml *** *** 182,188 !Comparison Operators comparison --- 182,188 !

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-13 Thread Pavel Stehule
2015-08-13 9:47 GMT+02:00 Shulgin, Oleksandr : > On Thu, Aug 13, 2015 at 9:25 AM, Pavel Stehule > wrote: > >> >> >> 2015-08-13 9:21 GMT+02:00 Marko Tiikkaja : >> >>> On 8/13/15 9:18 AM, Shulgin, Oleksandr wrote: >>> nnulls() >>> >>> I think I'd prefer num_nulls() over that. >>> >> >> ca

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-13 Thread Shulgin, Oleksandr
On Thu, Aug 13, 2015 at 9:25 AM, Pavel Stehule wrote: > > > 2015-08-13 9:21 GMT+02:00 Marko Tiikkaja : > >> On 8/13/15 9:18 AM, Shulgin, Oleksandr wrote: >> >>> nnulls() >>> >> >> I think I'd prefer num_nulls() over that. >> > > can be > > what about similar twin function num_nonulls()? > Yes.

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-13 Thread Atri Sharma
On Thu, Aug 13, 2015 at 12:55 PM, Pavel Stehule wrote: > > > 2015-08-13 9:21 GMT+02:00 Marko Tiikkaja : > >> On 8/13/15 9:18 AM, Shulgin, Oleksandr wrote: >> >>> nnulls() >>> >> >> I think I'd prefer num_nulls() over that. >> > > can be > > what about similar twin function num_nonulls()? > > +1

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-13 Thread Pavel Stehule
2015-08-13 9:21 GMT+02:00 Marko Tiikkaja : > On 8/13/15 9:18 AM, Shulgin, Oleksandr wrote: > >> nnulls() >> > > I think I'd prefer num_nulls() over that. > can be what about similar twin function num_nonulls()? Pavel > > > .m > > > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers@post

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-13 Thread Marko Tiikkaja
On 8/13/15 9:18 AM, Shulgin, Oleksandr wrote: nnulls() I think I'd prefer num_nulls() over that. .m -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-13 Thread Shulgin, Oleksandr
On Thu, Aug 13, 2015 at 2:19 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Aug 12, 2015 at 4:11 PM, Tom Lane wrote: > >> Peter Geoghegan writes: >> > On Wed, Aug 12, 2015 at 10:30 AM, Alvaro Herrera >> > wrote: >> >> The name count_nulls() suggest an aggregate function to

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread David G. Johnston
On Wed, Aug 12, 2015 at 4:11 PM, Tom Lane wrote: > Peter Geoghegan writes: > > On Wed, Aug 12, 2015 at 10:30 AM, Alvaro Herrera > > wrote: > >> The name count_nulls() suggest an aggregate function to me, though. > > > I thought the same. > > Ditto. I'd be fine with this if we can come up with

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Tom Lane
Peter Geoghegan writes: > On Wed, Aug 12, 2015 at 10:30 AM, Alvaro Herrera > wrote: >> The name count_nulls() suggest an aggregate function to me, though. > I thought the same. Ditto. I'd be fine with this if we can come up with a name that doesn't sound like an aggregate. The best I can do o

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Pavel Stehule
2015-08-12 19:37 GMT+02:00 Marko Tiikkaja : > On 2015-08-12 7:35 PM, Pavel Stehule wrote: > >> maybe nulls_count ? >> >> we have regr_count already >> > > But that's an aggregate as well.. > my mistake Pavel > > > .m >

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Marko Tiikkaja
On 2015-08-12 7:35 PM, Pavel Stehule wrote: maybe nulls_count ? we have regr_count already But that's an aggregate as well.. .m -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Pavel Stehule
2015-08-12 19:32 GMT+02:00 Peter Geoghegan : > On Wed, Aug 12, 2015 at 10:30 AM, Alvaro Herrera > wrote: > > The name count_nulls() suggest an aggregate function to me, though. > > I thought the same. > maybe nulls_count ? we have regr_count already Regards Pavel > > > -- > Peter Geoghegan

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Marko Tiikkaja
On 2015-08-12 7:23 PM, Greg Stark wrote: On Wed, Aug 12, 2015 at 6:18 PM, Marko Tiikkaja wrote: Will finish this up for the next CF, unless someone wants to tell me how stupid this idea is before that. I'm kind of puzzled what kind of schema would need this. The first example I could find f

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Peter Geoghegan
On Wed, Aug 12, 2015 at 10:30 AM, Alvaro Herrera wrote: > The name count_nulls() suggest an aggregate function to me, though. I thought the same. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgre

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Pavel Stehule
Hi 2015-08-12 19:18 GMT+02:00 Marko Tiikkaja : > Hi, > > I'd like to suggest $SUBJECT for inclusion in Postgres 9.6. I'm sure > everyone would've found it useful at some point in their lives, and the > fact that it can't be properly implemented in any language other than C I > think speaks for t

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Alvaro Herrera
Greg Stark wrote: > On Wed, Aug 12, 2015 at 6:18 PM, Marko Tiikkaja wrote: > > Will finish this up for the next CF, unless someone wants to tell me how > > stupid this idea is before that. > > I'm kind of puzzled what kind of schema would need this. I've seen cases where you want some entity to

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Greg Stark
On Wed, Aug 12, 2015 at 6:18 PM, Marko Tiikkaja wrote: > Will finish this up for the next CF, unless someone wants to tell me how > stupid this idea is before that. I'm kind of puzzled what kind of schema would need this. -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgres

[HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Marko Tiikkaja
Hi, I'd like to suggest $SUBJECT for inclusion in Postgres 9.6. I'm sure everyone would've found it useful at some point in their lives, and the fact that it can't be properly implemented in any language other than C I think speaks for the fact that we as a project should provide it. A quic