pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
To: Paul A Jungwirth <pj@illuminatedcomputing.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: range_agg
Date: Tue, 09 Jul 2019 11:24:56 -0700
Message-ID: <0a4160cfcf126ab9dd74aedc40d2545367b05ba8.camel@j-davis.com> (raw)
In-Reply-To: <CAFj8pRC9jpw=CTKthhkLoy2+gHgxtLwH6gfBS3woL1xN9-DUDg@mail.gmail.com>
References: <16d71dc8-34cf-5ebd-1ce5-ccd93c0a14f9@illuminatedcomputing.com>
	<ba323e489b98029be5ba2d5c5cbc99795f333f48.camel@j-davis.com>
	<CA+renyX7jsWnyry6SOn-WSgdgQLtyFJ7SLWBVs+oatwQsMzvog@mail.gmail.com>
	<d9f99d9254ff638f82e1e7c91eaca039e9f9df68.camel@j-davis.com>
	<CA+renyU4jt64TtqP+rk_vdERXypBk5LQ+FQLCRcC4j3DVT8jeg@mail.gmail.com>
	<CAFj8pRC9jpw=CTKthhkLoy2+gHgxtLwH6gfBS3woL1xN9-DUDg@mail.gmail.com>

On Tue, 2019-07-09 at 07:08 +0200, Pavel Stehule wrote:
> 
> I am not against a multirange type, but I miss a explanation why you
> introduce new kind of types and don't use just array of ranges.
> 
> Introduction of new kind of types is not like introduction new type.

The biggest benefit, in my opinion, is that it means you can define
functions/operators that take an "anyrange" and return an
"anymultirange". That way you don't have to define different functions
for int4 ranges, date ranges, etc.

It starts to get even more complex when you want to add opclasses, etc.

Ranges and arrays are effectively generic types that need a type
parameter to become a concrete type. Ideally, we'd have first-class
support for generic types, but I think that's a different topic ;-)

Regards,
	Jeff Davis







view thread (152+ messages)  latest in thread

Message-ID: <0a4160cfcf126ab9dd74aedc40d2545367b05ba8.camel@j-davis.com>
Permalink:  ../0a4160cfcf126ab9dd74aedc40d2545367b05ba8.camel@j-davis.com/
Also on:    postgresql.org/message-id/0a4160cfcf126ab9dd74aedc40d2545367b05ba8.camel@j-davis.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pgsql@j-davis.com, pavel.stehule@gmail.com, pj@illuminatedcomputing.com
  Subject: Re: range_agg
  In-Reply-To: <0a4160cfcf126ab9dd74aedc40d2545367b05ba8.camel@j-davis.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox