"George Wright" <george.wright@infimatic.com> writes:
> badger=> select logid, starttime from tz where starttime BETWEEN '2007-01-22
> 02:30:00-03' and '2007-01-23 03:00:00-03';
> logid | starttime
> -------+------------------------
> 1 | 2007-01-22 23:00:00-06 <- is this right?
Why not? 2007-01-22 02:30:00-03 equates to 2007-01-21 23:30:00-06,
so it's before that time, and 2007-01-23 03:00:00-03 equates to
2007-01-23 00:00:00-06, so it's after.
> badger=> select logid, starttime from tz where starttime BETWEEN '2007-01-22
> 00:30:00-05' and '2007-01-23 01:00:00-05';
> badger=> select logid, starttime from tz where starttime BETWEEN '2007-01-22
> 23:30:00-06' and '2007-01-23 00:00:00-06';
Notice you forgot to adjust the date in the first value here, so these
are not equivalent boundary times.
regards, tom lane