I'm having some trouble with time with time zone
equalities in Postgres. timestamp with time zone
equality works how I would expect it to, where if the times are the same after normalizing the timezones, it should be true:
postgres=# select '2013-06-27 12:00:00 -0800'::timestamp with time zone = '2013-06-27 14:00:00 -0600'::timestamp with time zone;
?column?
----------
t
However, the same does not seem to apply to time with time zone
:
postgres=# select '12:00:00 -0800'::time with time zone = '14:00:00 -0600'::time with time zone;
?column?
----------
f
Yet inequalities work how I would expect them to:
postgres=# select '12:00:00 -0800'::time with time zone < '14:01:00 -0600'::time with time zone;
?column?
----------
t
postgres=# select '12:00:00 -0800'::time with time zone > '13:59:00 -0600'::time with time zone;
?column?
----------
t
Is there something I'm misunderstanding about time with time zone
? How can I evaluate for equality in a way that handles time zones the same way timestamp with time zone
equality does?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…