#45004 [Opn->Csd]: pg_insert doesn't accept valid timestamps
| From: | iliaa@php.net | Date: | Mon, 19 May 2008 15:18:56 +0000 |
| Subject: | #45004 [Opn->Csd]: pg_insert doesn't accept valid timestamps | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125116@lists.php.net to get a copy of this message | ||
ID: 45004
Updated by: iliaa@php.net
Reported By: deusmax at gmail dot com
-Status: Open
+Status: Closed
Bug Type: PostgreSQL related
Operating System: Linux 2.6.22
PHP Version: 5.2CVS-2008-05-15 (CVS)
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2008-05-15 11:36:25] deusmax at gmail dot com
Description:
------------
On inserting into a timestamp with time zone field the function
pg_insert() throws the following error:
pg_insert doesn't like timestamps with
Notice: pg_insert(): '2008-05-15T16:15:16+0000' does not match with
'^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([
\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\.[0-9]+){0,1}([
\t]*([+-][0-9]{1,2}(:[0-9]{1,2}){0,1}|[a-zA-Z]{1,5})){0,1})){0,1}$'
Pg_insert() works fine for '2008-05015T16:15:16+00',the timezone has
only 2 digits.
The 4 digit time zone is:
1) a valid PhP format, DATE_ISO8601
2) is accepted fine when doing a regular sql insert
It seems the regex use by pg_insert for the timestamps with timezone
should be updated to accept all formats defined by PhP constants DATE_*
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45004&edit=1