Re: range_agg

From: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: range_agg
Date: 2019-07-24 05:13:07
Message-ID: CA+renyVJuVOLP3=CaM5rQdqy6pttWQR3BrnqeP9xMjWrHaL3=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 23, 2019 at 3:32 PM Alvaro Herrera <alvherre(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-07-24 05:15:14 Re: stress test for parallel workers
Previous Message David Rowley 2019-07-24 04:57:42 Re: Change atoi to strtol in same place