Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 58FA3475BC6 for ; Tue, 13 Aug 2002 03:37:18 -0400 (EDT) Received: from dyatel.antar.bryansk.ru (dyatel.antar.bryansk.ru [195.239.214.110]) by postgresql.org (Postfix) with ESMTP id 95E464759B9 for ; Tue, 13 Aug 2002 03:37:17 -0400 (EDT) Received: from fduch by dyatel.antar.bryansk.ru with local (Exim 4.10) id 17eWEr-0003lC-00; Tue, 13 Aug 2002 11:37:13 +0400 Date: Tue, 13 Aug 2002 11:37:13 +0400 From: "Alexander M. Pravking" To: Christopher Kings-Lynne Cc: Lonh SENG , pgsql-sql@postgresql.org Subject: Re: Conversion Message-ID: <20020813073713.GB91244@dyatel.antar.bryansk.ru> References: <20020813070339.GA91244@dyatel.antar.bryansk.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/202 X-Sequence-Number: 9048 On Tue, Aug 13, 2002 at 03:14:38PM +0800, Christopher Kings-Lynne wrote: > > http://www.postgresql.org/idocs/index.php?datatype-datetime.html says: > > > > The types abstime and reltime are lower precision types which are used > > internally. You are discouraged from using any of these types in new > > applications and are encouraged to move any old ones over when > > appropriate. Any or all of these internal types might disappear in a > > future release. > > Yes, but in absence of: > > SELECT EXTRACT(TIMESTAMP FROM EPOCH '12341234234'); Sounds nice :) > (Hint Hint Thomas!!!) > > It's all he can do. I suggest using the syntax above to convert his integer > column to a timestamp column. Sure. I use the same. But I don't like it because of that caution :( The other way is SELECT 'epoch'::timestamp + (int4field::text || 's')::interval, but it's much much slower... And it seems not to handle timestamps after 2038-01-19. -- Fduch M. Pravking