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

2013-07-26 Thread Joe Van Dyk
On Friday, July 5, 2013, Jeff Davis wrote:

 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


Worth it to file a bug for this?


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

2013-07-05 Thread Jeff Davis
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





-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] casting tsrange to tstzrange doesn't seem to work?

2013-06-11 Thread Joe Van Dyk
# select tsrange(null)::tstzrange;
ERROR:  cannot cast type tsrange to tstzrange
LINE 1: select tsrange(null)::tstzrange;

Is this expected?

select null::timestamp::timestamptz;
works fine.