Re: count_nulls(VARIADIC "any") - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: count_nulls(VARIADIC "any")
Date
Msg-id CAFj8pRCH2W=oq-FiwA4-LT_0bB6n9AaVK2QOr+_quLm2UdWJyQ@mail.gmail.com
Whole thread Raw
In response to count_nulls(VARIADIC "any")  (Marko Tiikkaja <marko@joh.to>)
Responses Re: count_nulls(VARIADIC "any")  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
<div dir="ltr">Hi<br /><div class="gmail_extra"><br /><div class="gmail_quote">2015-08-12 19:18 GMT+02:00 Marko
Tiikkaja<span dir="ltr"><<a href="mailto:marko@joh.to" target="_blank">marko@joh.to</a>></span>:<br /><blockquote
class="gmail_quote"style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br /><br /> 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
weas a project should provide it.<br /><br /> A quick and dirty proof of concept (patch attached):<br /><br /> =#
selectcount_nulls(null::int, null::text, 17, 'bar');<br />  count_nulls<br /> -------------<br />            2<br /> (1
row)<br/><br /> Its natural habitat would be CHECK constraints, e.g:<br /><br />   CHECK (count_nulls(a,b,c) IN (0,
3))<br/><br /> Will finish this up for the next CF, unless someone wants to tell me how stupid this idea is before
that.<spanclass="HOEnZb"><font color="#888888"><br /><br /><br /> .m<br /></font></span></blockquote></div><br
/></div><divclass="gmail_extra">I am sending updated version - support num_nulls and num_notnulls<br /><br /></div><div
class="gmail_extra">Regards<br/><br /></div><div class="gmail_extra">Pavel<br /></div></div> 

pgsql-hackers by date:

Previous
From: Peter Krauss
Date:
Subject: Proposal for JSONB functions for internal representation casting insted text-casting
Next
From: Pavel Stehule
Date:
Subject: Re: count_nulls(VARIADIC "any")