Re: range_agg - Mailing list pgsql-hackers

From Paul A Jungwirth
Subject Re: range_agg
Date
Msg-id CA+renyVJuVOLP3=CaM5rQdqy6pttWQR3BrnqeP9xMjWrHaL3=Q@mail.gmail.com
Whole thread Raw
In response to Re: range_agg  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: range_agg
List pgsql-hackers
On Tue, Jul 23, 2019 at 3:32 PM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Just checking if you've had a chance to make progress on this.

Not a lot. :-) But I should have more time for it the next few weeks
than I did the last few. I do have some code for creating concrete
multirange types (used when you create a concrete range type) and
filling in a TypeCacheEntry based on the range type oid---which I know
is all very modest progress. I've been working on a multirange_in
function and mostly just learning about Postgres varlena and TOASTed
objects by reading the code for range_in & array_in.

Here is something from my multirangetypes.h:

/*
 * Multiranges are varlena objects, so must meet the varlena convention that
 * the first int32 of the object contains the total object size in bytes.
 * Be sure to use VARSIZE() and SET_VARSIZE() to access it, though!
 */
typedef struct
{
    int32       vl_len_;            /* varlena header (do not touch
directly!) */
    Oid         multirangetypid;    /* multirange type's own OID */
    /*
     * Following the OID are the range objects themselves.
     * Note that ranges are varlena too,
     * depending on whether they have lower/upper bounds
     * and because even their base types can be varlena.
     * So we can't really index into this list.
     */
} MultirangeType;

I'm working on parsing a multirange much like we parse an array,
although it's a lot simpler because it's a single dimension and there
are no nulls.

I know that's not much to go on, but let me know if any of it worries you. :-)

Paul



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Change atoi to strtol in same place
Next
From: Tom Lane
Date:
Subject: Re: stress test for parallel workers