Skip site navigation (1) Skip section navigation (2)

Re: Datetime patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: greg(at)turnstep(dot)com
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Datetime patch
Date: 2003-07-25 17:28:14
Message-ID: 200307251728.h6PHSEi13494@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
OK, I tested the patch and found that it still does proper date validity
checking:
	
	test=> select '2003-09-31'::date;
	ERROR:  Bad date external representation '2003-09-31'

I did find the following change in the regression tests:

  INSERT INTO TIMESTAMP_TBL VALUES ('02-10-1997 17:32:01 PST');
  INSERT INTO TIMESTAMP_TBL VALUES ('19970210 173201 PST');
  INSERT INTO TIMESTAMP_TBL VALUES ('97FEB10 5:32:01PM UTC');
+ ERROR:  Bad timestamp external representation '97FEB10 5:32:01PM UTC'
  INSERT INTO TIMESTAMP_TBL VALUES ('97/02/10 17:32:01 UTC');
+ ERROR:  Bad timestamp external representation '97/02/10 17:32:01 UTC'
  INSERT INTO TIMESTAMP_TBL VALUES ('97.041 17:32:01 UTC');
+ ERROR:  Bad timestamp external representation '97.041 17:32:01 UTC'
 
I didn't know we supported the first format, though it looks nice.

I don't think we want to support the second format, so the error is
correct.

The last format looks like it is year.days_from_year_start, which I also
didn't know we supported, but again looks interesting, if strange.

Comments?

---------------------------------------------------------------------------

greg(at)turnstep(dot)com wrote:
[ There is text before PGP section. ]
> 
[ PGP not available, raw data follows ]
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> NotDashEscaped: You need GnuPG to verify this message
> 
> 
> > I believe this conditional is incorrect.  The second part should be DTK_M(DAY).
> 
> Thank you - that is correct. Revised patch below.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2003-07-25 19:19:31
Subject: Re: Datetime patch
Previous:From: eleinDate: 2003-07-25 17:24:08
Subject: Re: best way to determine start of new statement within a function? (resend)

pgsql-patches by date

Next:From: Tom LaneDate: 2003-07-25 19:08:11
Subject: Re: UPDATED Patch for adding DATACUBE operator
Previous:From: gregDate: 2003-07-25 15:12:13
Subject: Re: Datetime patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group