chrisj <chrisj(dot)wood(at)sympatico(dot)ca> writes:
> When I first saw your solution I thought it was logically going to do
> (notice the parentheses):
> select ('2006-07-13 09:20:00'::timestamp) at time zone 'EST5EDT';
> which does not help
Well, actually, that's exactly what it does. AT TIME ZONE is an
operator that converts timestamp without time zone to timestamp with
time zone (or vice versa). I guess you could easily get confused
here, but AT is not WITH.
> , cast(start_datetime as timestamp(0) without time zone)::timestamp at
> time zone B.timezone_ch
That's redundant --- you're casting the result of the cast to timestamp
(implicitly without time zone), then applying the AT TIME ZONE operator.
regards, tom lane