pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karel Zak <zakkr@zf.jcu.cz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: jason.servetar@ccgenesis.com
Cc: pgsql-sql@postgresql.org
Subject: Re: to_date/to timestamp going to BC
Date: Thu, 4 Oct 2001 10:41:49 +0200
Message-ID: <20011004104149.B9858@zf.jcu.cz> (raw)
In-Reply-To: <11453.1002143642@sss.pgh.pa.us>
References: <309339290B4FD31184BC0060B06888CB01D0FDF2@CADILLAC>
	<11453.1002143642@sss.pgh.pa.us>

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  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz



view thread (7+ messages)  latest in thread

Message-ID: <20011004104149.B9858@zf.jcu.cz>
Permalink:  ../20011004104149.B9858@zf.jcu.cz/
Also on:    postgresql.org/message-id/20011004104149.B9858@zf.jcu.cz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: zakkr@zf.jcu.cz, tgl@sss.pgh.pa.us, jason.servetar@ccgenesis.com
  Subject: Re: to_date/to timestamp going to BC
  In-Reply-To: <20011004104149.B9858@zf.jcu.cz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox