Re: casting tsrange to tstzrange doesn't seem to work? - Mailing list pgsql-general

From Jeff Davis
Subject Re: casting tsrange to tstzrange doesn't seem to work?
Date
Msg-id 1373072826.7056.49.camel@jdavis
Whole thread Raw
In response to casting tsrange to tstzrange doesn't seem to work?  (Joe Van Dyk <joe@tanga.com>)
Responses Re: casting tsrange to tstzrange doesn't seem to work?
List pgsql-general
On Tue, 2013-06-11 at 14:05 -0700, Joe Van Dyk wrote:
> # select tsrange(null)::tstzrange;
> ERROR:  cannot cast type tsrange to tstzrange
> LINE 1: select tsrange(null)::tstzrange;
>
I agree that there should be a cast between tsrange and tstzrange.

Unfortunately, this cant work generally for all range types, because the
total order might be different. For instance, we can't cast between a
textrange and int4range, because:

   ['09','1']

is a valid text range, but:

   [9,1]

is not.

Regards,
    Jeff Davis





pgsql-general by date:

Previous
From: Ketana Patel
Date:
Subject: Re: General Query on Roles - Reg
Next
From: Joe Van Dyk
Date:
Subject: Re: odd locking behaviour