Received: from ara.zf.jcu.cz (ara.zf.jcu.cz [160.217.161.4]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f948g3n99729 for ; Thu, 4 Oct 2001 04:42:07 -0400 (EDT) (envelope-from zakkr@zf.jcu.cz) Received: from ara.zf.jcu.cz (zakkr@localhost [127.0.0.1]) by localhost (8.12.0.Beta7/8.12.0.Beta7/Debian 8.12.0.Beta7-1) with ESMTP id f948foTh018985; Thu, 4 Oct 2001 10:41:50 +0200 Received: (from zakkr@localhost) by ara.zf.jcu.cz (8.12.0.Beta7/8.12.0.Beta7/Debian 8.12.0.Beta7-1) id f948fnvP018984; Thu, 4 Oct 2001 10:41:49 +0200 Date: Thu, 4 Oct 2001 10:41:49 +0200 From: Karel Zak To: Tom Lane Cc: jason.servetar@ccgenesis.com, pgsql-sql@postgresql.org Subject: Re: to_date/to timestamp going to BC Message-ID: <20011004104149.B9858@zf.jcu.cz> References: <309339290B4FD31184BC0060B06888CB01D0FDF2@CADILLAC> <11453.1002143642@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <11453.1002143642@sss.pgh.pa.us>; from tgl@sss.pgh.pa.us on Wed, Oct 03, 2001 at 05:14:02PM -0400 X-Archive-Number: 200110/45 X-Sequence-Number: 5000 On Wed, Oct 03, 2001 at 05:14:02PM -0400, Tom Lane wrote: > jason.servetar@ccgenesis.com writes: > > Can someone tell me if this is a bug with the date functions or am I using > > them incorrectly? > > I get the right thing when I use the right format: > > regression=# select dt, to_timestamp(dt, 'FMMonth dd, yyyy') from test_date; > dt | to_timestamp > ----------------+------------------------ > March 11, 1997 | 1997-03-11 00:00:00-05 > (1 row) > > However, I'd agree that this shows a lack of robustness in to_timestamp; > it's not objecting to data that doesn't match the format. The manual is transparent about this. I can add feauture that will check everythig, but users who knows read manual and use already debugged queries will spend CPU on non-wanted code. Hmm.. I look at Oracle, and it allows parse queries like: SVRMGR> select to_date('March 11, 1997', 'Month dd, yyyy') from dual; TO_DATE(' --------- 11-MAR-97 1 row selected. .. well, I add it to my TODO for 7.3 (I plan rewrite several things in to_* functions). Karel -- Karel Zak http://home.zf.jcu.cz/~zakkr/ C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz