X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A3622D1B342 for ; Tue, 3 Aug 2004 12:15:18 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49206-04 for ; Tue, 3 Aug 2004 15:14:35 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id B178AD1B398 for ; Tue, 3 Aug 2004 12:13:48 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i73FDTPs023179; Tue, 3 Aug 2004 11:13:29 -0400 (EDT) To: Michael Glaesemann Cc: Achilleus Mantzios , "Pedro B." , pgsql-sql@postgresql.org Subject: Re: Datetime In-reply-to: References: Comments: In-reply-to Michael Glaesemann message dated "Tue, 03 Aug 2004 22:26:14 +0900" Date: Tue, 03 Aug 2004 11:13:29 -0400 Message-ID: <23178.1091546009@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/26 X-Sequence-Number: 18523 Michael Glaesemann writes: > No. I'm just saying that PostgreSQL does not represent or store > timestamps as epoch timestamps internally. You're wrong. It's not exactly Unix-like because we use a different epoch date (2000-1-1 not 1970-1-1) but the concept is just the same: what's stored is the number of seconds before or after the epoch. The default is to store this as a double precision number (hence supporting fractional seconds, with a machine-dependent amount of precision) but you can compile the server to use 64-bit integers instead. In that case the integer value actually represents microseconds before or after the epoch, and so the precision is fixed at microseconds. What you see when you display the value is an external textual representation, not the internal form. This is generally true for all Postgres datatypes except text/varchar/char ... regards, tom lane