ID:               41144
 Updated by:       [EMAIL PROTECTED]
 Reported By:      shade at nekto dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         PostgreSQL related
 Operating System: Windows
 PHP Version:      5.2.1
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:
------------------------------------------------------------------------

[2008-10-28 22:28:19] [EMAIL PROTECTED]

yohgaki seems to have left us so de-assigning.

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

[2007-04-20 05:46:56] shade at nekto dot com

Err..
>I am trying to insert 14:27 value in the datetime field.
Really - in TIME field. Here is SQL: "time_from   time with time zone"

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

[2007-04-20 05:36:36] shade at nekto dot com

Description:
------------
I am trying to insert 14:27 value in the datetime field. I think its
correct, cause in PostgreSQL manual descripted following time inputs:

Table 8.11. Time Input
Example | Description 
04:05 | ISO 8601 
040506 | ISO 8601 
.... cutted here....
04:05:06 PST | time zone specified by name 
2003-04-12 04:05:06 America/New_York | time zone specified by full name


Only 2003-04-12 04:05:06 matches by time regexp in pg_convert.
Here the reported regexp:
'^([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}$'

Its realizes logic 'date and maybe time', but it's not only possible
input. Also i confised by [ \t]+ , united with XX:XX part of regexp.
I think that regexp must be like that:
'^(([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2}){0,1}([
\t]+){0,1}(([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}$'

Expected result:
----------------
Inserted value in database table

Actual result:
--------------
Notice: pg_insert() [function.pg-insert]: '15:04' 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}$' in
C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\data\index.php on line 226



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


-- 
Edit this bug report at http://bugs.php.net/?id=41144&edit=1

Reply via email to