Bug #71998 [Opn->Csd]: Function pg_insert does not insert when column type = inet
Edit report at https://bugs.php.net/bug.php?id=71998&edit=1
ID: 71998
Updated by: ab@php.net
Reported by: jaroslav_cerny at centrum dot cz
Summary: Function pg_insert does not insert when column type
= inet
-Status: Open
+Status: Closed
Type: Bug
Package: PostgreSQL related
Operating System: Windows
PHP Version: 7.0.5
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b4ab0effc76385a3e1d7cded722a27481019b481
Log: Fixed bug #71998 Function pg_insert does not insert when column type = inet
Previous Comments:
------------------------------------------------------------------------
[2016-04-09 15:43:11] jaroslav_cerny at centrum dot cz
PostgreSQL 9.5.2, 64bit
------------------------------------------------------------------------
[2016-04-09 15:40:38] jaroslav_cerny at centrum dot cz
Description:
------------
Hello,
pg_insert fails when PostgreSQL column type is inet. Standard pg_query runs without issue.
Test script:
---------------
PostgreSQL:
CREATE TABLE tmp_statistics
(
id integer NOT NULL,
remote_addr inet
);
PHP:
$data = Array("id" => 1, "remote_addr" => '127.0.0.1');
$dbconn = getDB(); // open connection
$res = pg_insert($dbconn, 'tmp_statistics', $data);
echo pg_last_error($dbconn);
// Notice: pg_insert(): Expects NULL or string for 'inet' (remote_addr) in ...
pg_query($dbconn, "insert into tmp_statistics (id, remote_addr) values (2,
'127.0.0.1')"); // OK, record inserted
Expected result:
----------------
Two inserted records
Actual result:
--------------
Only second record is inserted
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71998&edit=1
Thread (3 messages)