Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 6D8F3930E1E for ; Fri, 3 Aug 2012 12:34:36 -0300 (ADT) Received: from mail.dhs-club.com ([208.69.229.2]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SxJtb-0004Ph-AT for pgsql-admin@postgresql.org; Fri, 03 Aug 2012 15:34:35 +0000 Received: from [192.168.0.11] (hq.clubshop.com [208.78.129.189]) (authenticated bits=0) by mail.dhs-club.com (8.14.4/8.14.4) with ESMTP id q73FYLPo006547 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Fri, 3 Aug 2012 15:34:22 GMT Message-ID: <501BEF7C.1030403@dhs-club.com> Date: Fri, 03 Aug 2012 11:34:20 -0400 From: Bill MacArthur User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Messed up time zones References: <501B8C6F.6040100@shopzeus.com> <501BAA84.9010306@shopzeus.com> <501BAE33.4090102@shopzeus.com> <16399.1344003584@sss.pgh.pa.us> <501BED07.5070603@shopzeus.com> In-Reply-To: <501BED07.5070603@shopzeus.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.70 on 208.69.229.2 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/25 X-Sequence-Number: 39846 On 8/3/2012 11:23 AM, Laszlo Nagy wrote: >> 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. > Oh I see. So actually they don't store the zone? I have seen that timestamptz and timestamp both occupy 8 bytes, but I didn't understand completely. > > It also means that if I want to store the actual time zone (in what the value was originally recorded), then I have to store the zone in a separate field. Later I can convert back to the original time zone, but only with an external program. > > Fine with me. I'm happy with this, just I did not understand how it works. You could store the zone in a separate field and then create a VIEW on the table that used a function to take both values and return the timestamptz just as it was inserted.