Received: from linuxmail.lgsinc.com (unknown [12.22.4.163]) by postgresql.org (Postfix) with ESMTP id 44296474E42 for ; Tue, 23 Jul 2002 17:29:57 -0400 (EDT) Received: from timetop ([10.13.15.254]) by linuxmail.lgsinc.com (8.11.0/8.8.7) with SMTP id g6NLTj124322; Tue, 23 Jul 2002 14:29:46 -0700 Date: Tue, 23 Jul 2002 14:25:28 -0700 From: Tim Ellis To: "Robert M. Meyer" Cc: jboes@nexcerpt.com, pgsql-admin@postgresql.org Subject: Re: Odd error in timestamp processing Message-Id: <20020723142528.77dff668.Tim.Ellis@gamet.com> In-Reply-To: <1027449659.25568.37.camel@skymaster> References: <1027449659.25568.37.camel@skymaster> Organization: Gamet X-Mailer: Sylpheed version 0.7.4 (GTK+ 1.2.10; i586-mandrake-linux-gnu) WerdupHomey: 3.14159265358979323 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200207/329 X-Sequence-Number: 5013 > We had this problem, too. Very annoying. It appears to be a bug in > 7.1.x. The way we got around it was to dump the DB out to a file and > run sed on the file with the script: > s/:60/:59/ > > Then feeding that output into psql. > > Of course, our database doesn't use ':' followed by numbers for anything > but timestamps so your mileage may vary. Not knowing your dataset, it's safer to run it through a Perl script using: if ($line =~ /^(.*?)(\d\d:\d\d:)60(\.\d\d-\d\d.*)$/) { $newLine = $1 . $2 . "59" . $3; } else { $newLine = $line; } This pretty much makes sure that any ":60" you get is within a string like **:**:60:**-** where each * is a 0-9. That, or use awk as well as sed to make sure you get the proper :60 replaced. In any case, I wouldn't trust my large dataset to contain only improper :60's. I've been bitten too many times by a too-generic s/XYZ/ABC/ in the past. -- Tim Ellis Senior Database Architect Gamet, Inc.