Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id A8CD1930E1E for ; Fri, 3 Aug 2012 11:19:58 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SxIjN-00036y-Q0 for pgsql-admin@postgresql.org; Fri, 03 Aug 2012 14:19:58 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q73EJiVM016400; Fri, 3 Aug 2012 10:19:45 -0400 (EDT) From: Tom Lane To: Laszlo Nagy cc: pgsql-admin@postgresql.org Subject: Re: Messed up time zones In-reply-to: <501BAE33.4090102@shopzeus.com> References: <501B8C6F.6040100@shopzeus.com> <501BAA84.9010306@shopzeus.com> <501BAE33.4090102@shopzeus.com> Comments: In-reply-to Laszlo Nagy message dated "Fri, 03 Aug 2012 12:55:47 +0200" Date: Fri, 03 Aug 2012 10:19:44 -0400 Message-ID: <16399.1344003584@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/23 X-Sequence-Number: 39844 Laszlo Nagy writes: > So how do I create a query that results in something like: > a > ------------------------------ > Sun Oct 30 02:00:00 2011 +0500 > Sun Oct 30 02:00:00 2011 +0600 > (2 rows) Set the "timezone" setting to the zone you have in mind, and then just print the values. The reason there's no manual way to do rotation across zones is that there's no need for one because it's done automatically during printout of a timestamptz value. I suspect that you have not correctly internalized what timestamptz values actually are. Internally they are just time values specified in UTC (or UT1 if you want to be picky). On input, the value is rotated from whatever zone is specified in the string (or implicitly specified by "timezone") to UTC. On output, the value is rotated from UTC to whatever the current "timezone" setting is. regards, tom lane