Re: range_agg - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: range_agg
Date
Msg-id 20191220191306.GA9332@alvherre.pgsql
Whole thread Raw
In response to Re: range_agg  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On 2019-Dec-20, Alvaro Herrera wrote:

> I am not convinced that adding TYPTYPE_MULTIRANGE is really necessary.
> Why can't we just treat those types as TYPTYPE_RANGE and distinguish
> them using TYPCATEGORY_MULTIRANGE?  That's what we do for arrays.  I'll
> try to do that next.

I think this can be simplified if we make the the multirange's
pg_type.typelem carry the base range's OID (the link in the other
direction already appears as pg_range.mltrngtypid, though I'd recommend
renaming that to pg_range.rngmultitypid to maintain the "rng" prefix
convention).  Then we can distinguish a multirange from a plain range
easily, both of which have typtype as TYPTYPE_RANGE, because typelem !=
0 in a multi.  That knowledge can be encapsulated easily in
type_is_multirange and pg_dump's getTypes.

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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Superuser can permit passwordless connections on postgres_fdw
Next
From: Paul A Jungwirth
Date:
Subject: Re: range_agg