Re: so, does this overlap or not...? - fencepost question on overlaps() - Mailing list pgsql-general

From Tom Lane
Subject Re: so, does this overlap or not...? - fencepost question on overlaps()
Date
Msg-id 24445.1275575283@sss.pgh.pa.us
Whole thread Raw
In response to so, does this overlap or not...? - fencepost question on overlaps()  (Frank van Vugt <ftm.van.vugt@foxi.nl>)
Responses Re: so, does this overlap or not...? - fencepost question on overlaps()  (Frank van Vugt <ftm.van.vugt@foxi.nl>)
List pgsql-general
Frank van Vugt <ftm.van.vugt@foxi.nl> writes:
> This doesn't seem to make sense to me, can someone explain the rationale
> behind it?

The rationale is "do what the SQL spec says" ;-)

What the spec says is

              ( S1 > S2 AND NOT ( S1 >= T2 AND T1 >= T2 ) )
              OR
              ( S2 > S1 AND NOT ( S2 >= T1 AND T2 >= T1 ) )
              OR
              ( S1 = S2 AND ( T1 <> T2 OR T1 = T2 ) )

I seem to recall a previous discussion in the PG lists where we
reverse-engineered a plausible explanation of what the standards
committee had in mind when they wrote this, but I don't have time
right now to go looking for it.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Lock issues with partitioned table
Next
From: Bruce Momjian
Date:
Subject: Re: Auto-partitioning in COPY