Re: Range types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Cc: Scott Bailey <artacus(at)comcast(dot)net>, hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Range types
Date: 2009-12-17 14:43:57
Message-ID: 1295.1261061037@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dimitri Fontaine <dfontaine(at)hi-media(dot)com> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> Hm, how would you do it with LATERAL? The problem is not so much
>> composition as the need for a variable number of rounds of
>> composition.

> Let's have a try at it:

> select p2_member, array_accum(p1)
> from unnest(p2) as p2_member
> lateral (select period_except(p1_member, p2_member)
> from unnest(p1) p1_member) as x(p1);

I don't think that does it. Maybe I misunderstand LATERAL, but what
that looks like to me is that each p1 will be separately filtered by
each p2, giving rise to a distinct element in the output. What we
need is for each p1 to be filtered by *all* p2's, successively
(though in any order).

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-12-17 14:56:36 Re: Hot Standby and prepared transactions
Previous Message Robert Haas 2009-12-17 14:35:39 Re: NOT IN Doesn't use Anti Joins?