Re: casting tsrange to tstzrange doesn't seem to work?

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Joe Van Dyk <joe(at)tanga(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: casting tsrange to tstzrange doesn't seem to work?
Date: 2013-07-06 01:07:06
Message-ID: 1373072826.7056.49.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Van Dyk 2013-07-06 19:26:56 Re: odd locking behaviour
Previous Message Johann Eggers 2013-07-05 19:56:48 unsubscribe