From: deusmax at gmail dot com
Operating system: Linux 2.6.22
PHP version: 5.2CVS-2008-05-15 (CVS)
PHP Bug Type: PostgreSQL related
Bug description: pg_insert doesn't accept valid timestamps
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 bug report at http://bugs.php.net/?id=45004&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45004&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45004&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45004&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45004&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45004&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45004&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45004&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45004&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45004&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45004&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45004&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45004&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45004&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45004&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45004&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45004&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45004&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45004&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45004&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45004&r=mysqlcfg