Looking over the AT TIME ZONE docs, I think they are subtly confusing. The order of conversion specific in the first example should _start_ with the assumption of local time zone for the time stamp, not something that happens after AT TIME ZONE is applied. The ordering in current docs makes the second example confusing too.
The attached patch fixes this. -- Bruce Momjian <br...@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml new file mode 100644 index bb794e0..ba22b7d *** a/doc/src/sgml/func.sgml --- b/doc/src/sgml/func.sgml *************** SELECT TIMESTAMP '2001-02-16 20:38:40' A *** 8145,8153 **** SELECT TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-05' AT TIME ZONE 'MST'; <lineannotation>Result: </lineannotation><computeroutput>2001-02-16 18:38:40</computeroutput> </screen> ! The first example takes a time stamp without time zone and interprets it as MST time ! (UTC-7), which is then converted to PST (UTC-8) for display. The second example takes ! a time stamp specified in EST (UTC-5) and converts it to local time in MST (UTC-7). </para> <para> --- 8145,8154 ---- SELECT TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-05' AT TIME ZONE 'MST'; <lineannotation>Result: </lineannotation><computeroutput>2001-02-16 18:38:40</computeroutput> </screen> ! The first example takes a time stamp without time zone, converts it ! to local time (PST, UTC-8), then converts it to time in MST (UTC-7) ! for display. The second example takes a time stamp specified in EST ! (UTC-5) and converts it to time in MST (UTC-7) for display. </para> <para>