X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 307EED1B4AF for ; Tue, 6 Jan 2004 23:35:30 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 05128-01 for ; Tue, 6 Jan 2004 19:34:42 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 3690CD1B438 for ; Tue, 6 Jan 2004 19:34:40 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i06NYdU6067073 for ; Tue, 6 Jan 2004 23:34:39 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i06NTmRV064144 for pgsql-sql@postgresql.org; Tue, 6 Jan 2004 23:29:48 GMT From: boyd X-Newsgroups: comp.databases.postgresql.sql Subject: unix time -> timestamp User-Agent: MT-NewsWatcher/3.2 (PPC Mac OS X) Message-ID: Lines: 13 X-Complaints-To: abuse@usenetserver.com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly. Date: Tue, 06 Jan 2004 18:29:16 -0500 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/57 X-Sequence-Number: 16450 I'm pretty sure in 7.0 postgres, (but I may be wrong) you could insert directly from a perl script something like this: $time = time; # this gives epoch seconds $sql = "insert into mytable values(..., timestamp($time), ...) "; And then the $sql string would run with the DBI call, etc. When I tried the same script on 7.2, it would not take it. I think I once found another way to do it in 7.2. Of course, I can create a formatted string in perl that will be accepted by the insert, but it seems inefficient to have to do it through strings. Boyd tbmooreATbealenetDOTcom