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 3525D3A3AFB for ; Sun, 16 Jan 2005 01:50:52 +0000 (GMT) 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 78869-09 for ; Sun, 16 Jan 2005 01:50:38 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 1315B3A3B15 for ; Sun, 16 Jan 2005 01:50:40 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j0G1ob1D056467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 15 Jan 2005 18:50:40 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j0G1obx0034907; Sat, 15 Jan 2005 18:50:37 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j0G1oaom034906; Sat, 15 Jan 2005 18:50:36 -0700 (MST) (envelope-from mfuhr) Date: Sat, 15 Jan 2005 18:50:36 -0700 From: Michael Fuhr To: Joel Fradkin Cc: pgsql-sql@postgresql.org Subject: Re: I am writing a MS SQL server conversion utility and am having an issue with timestamp Message-ID: <20050116015036.GA34820@winnie.fuhr.org> References: <003c01c4fa7e$1d463460$797ba8c0@jfradkin> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003c01c4fa7e$1d463460$797ba8c0@jfradkin> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/114 X-Sequence-Number: 19902 On Fri, Jan 14, 2005 at 04:15:02PM -0500, Joel Fradkin wrote: > Any one have a good idea for dealing with a timestamp where only time is > available on some of the source records? TIMESTAMP values contain a date and time. If you have only times then they'll have to go in a TIME column or you'll have to use a bogus date in a TIMESTAMP column (ugly). > Some records have both time and day. > > My MSSQL database has 290 tables so splitting the fields would be a very > large project. Couldn't a conversion be done programatically? Or are there too many special cases that need wetware intervention? > Is there a way to add just the time part of date time to timestamp? Not that I'm aware of. Unless I'm mistaken you'll have to use separate DATE and TIME columns and set the date to NULL, else assign a bogus date where the date is missing, which wouldn't smell very nice. -- Michael Fuhr http://www.fuhr.org/~mfuhr/