Thread: "July" missing from datetime.c

"July" missing from datetime.c

From
"Greg Sabino Mullane"
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

Patch below fixes the following problem:

template1=# create table foobar (cdate timestamp);
CREATE
template1=# insert into foobar values('11:23 Friday, Jun 1, 2001 EDT');
INSERT 16558 1
template1=# insert into foobar values('11:23 Friday, June 1, 2001 EDT');
INSERT 16559 1
template1=# insert into foobar values('11:23 Sunday, Jul 1, 2001 EDT');
INSERT 16560 1
template1=# insert into foobar values('11:23 Sunday, July 1, 2001 EDT');
ERROR:  Bad timestamp external representation '11:23 Friday, July 7, 2000 EDT'

(Just one line added, so I've inlined the patch)

*** ./src/backend/utils/adt/datetime.c.orig    Tue Dec 18 12:30:17 2001
--- ./src/backend/utils/adt/datetime.c    Tue Dec 18 12:30:31 2001
***************
*** 272,273 ****
--- 272,274 ----
      {"jul", MONTH, 7},
+     {"july", MONTH, 7},
      {"julian", UNITS, JULIAN},



Greg Sabino Mullane
greg@turnstep.com
PGP Key: 0x14964AC8 200112181250

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE8H4KLvJuQZxSWSsgRAqc7AKDyu+5VNq3SB6lWF86Mu+rsnRunmgCfeGNg
fkMXy+oKuEiX4sdV67TaR3I=
=xtAz
-----END PGP SIGNATURE-----



Re: "July" missing from datetime.c

From
Thomas Lockhart
Date:
> template1=# insert into foobar values('11:23 Sunday, July 1, 2001 EDT');
> ERROR:  Bad timestamp external representation '11:23 Friday, July 7, 2000 EDT'
> (Just one line added, so I've inlined the patch)
>         {"jul", MONTH, 7},
> +       {"july", MONTH, 7},
>         {"julian", UNITS, JULIAN},

Got it, thanks. I'll commit a fix in the next day or so. Note that this
table *must* be strictly ordered to allow the optimized table lookup to
work. So, you should place "july" after "julian", not before.

                  - Thomas