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

From Alvaro Herrera
Subject Re: count_nulls(VARIADIC "any")
Date
Msg-id 20150812173038.GI3040@postgresql.org
Whole thread Raw
In response to Re: count_nulls(VARIADIC "any")  (Greg Stark <stark@mit.edu>)
Responses Re: count_nulls(VARIADIC "any")  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
Greg Stark wrote:
> On Wed, Aug 12, 2015 at 6:18 PM, Marko Tiikkaja <marko@joh.to> 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 be of either of some
number of types.  In those cases you have nullable FKs in separate
columns, and only one of them can be non null.

The name count_nulls() suggest an aggregate function to me, though.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: count_nulls(VARIADIC "any")
Next
From: Pavel Stehule
Date:
Subject: Re: count_nulls(VARIADIC "any")