Bug #71998 [NEW]: Function pg_insert does not insert when column type = inet

From: Date: Sat, 09 Apr 2016 15:40:41 +0000
Subject: Bug #71998 [NEW]: Function pg_insert does not insert when column type = inet
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200457@lists.php.net to get a copy of this message
From:             jaroslav_cerny at centrum dot cz
Operating system: Windows
PHP version:      7.0.5
Package:          PostgreSQL related
Bug Type:         Bug
Bug description:Function pg_insert does not insert when column type = inet

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 bug report at https://bugs.php.net/bug.php?id=71998&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71998&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71998&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71998&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71998&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71998&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71998&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71998&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71998&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71998&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71998&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71998&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71998&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71998&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71998&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71998&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71998&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71998&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71998&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71998&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71998&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#200457) next »