Re: Range Types: << >> -|- ops vs empty range

From: "Erik Rijkers" <er(at)xs4all(dot)nl>
To: "Jeff Davis" <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Range Types: << >> -|- ops vs empty range
Date: 2011-02-11 14:09:02
Message-ID: a73614acd4e2240c128dec04f42bce06.squirrel@webmail.xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, February 9, 2011 09:35, Jeff Davis wrote:
> Updated patch.
>

The operators << >> and -|- have the following behavior with empty ranges:

testdb=# select '-'::int4range << range(200,300);
ERROR: empty range
testdb=# select '-'::int4range >> range(200,300);
ERROR: empty range
testdb=# select '-'::int4range -|- range(200,300);
ERROR: empty range

I'm not sure if that is deliberate behavior, but they seem
almost bugs to me.

Wouldn't it be better (and more practical) if these would
return false (or perhaps NULL, for 'unknown') ?

(the same goes for all the other range types, btw.)

Erik Rijkers

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-02-11 14:13:15 Re: ALTER EXTENSION UPGRADE, v3
Previous Message Dimitri Fontaine 2011-02-11 14:00:56 Re: ALTER EXTENSION UPGRADE, v3