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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-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

Attachment Content-Type Size
unknown_filename text/plain 7.1 KB

In response to

Responses

Browse pgsql-hackers by date

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

Browse pgsql-patches by date

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