From:             jasen at treshna dot com
Operating system: linux
PHP version:      5.4.13
Package:          PostgreSQL related
Bug Type:         Bug
Bug description:pg_convert  barfs on enum columns

Description:
------------
pg_convert, pg_update, pg_insert 
can't handle inputs that reference enum columns.

syntactically enum columns can be treated like string columns.



Test script:
---------------
<?php
function sql_assert($c,$q)
{
        $r=pg_query($c,$q);
        if($r)
        {
                pg_free_result($r);
                return;
        }
        echo "FAILED: $q\nERROR:".pg_last_error($c)."\n";
        echo "can't initialise the test environment - giving up";
        die(1);
}
$con=pg_connect("host=127.0.0.1 user=test password=php5 dbname=phptest");
sql_assert($con,"drop type if exists enumtest cascade;");
sql_assert($con," create type enumtest as enum ( 'alpha', 'beta', 'gamma'
);");
sql_assert($con," drop table if exists e_test;");
sql_assert($con," create table e_test( id integer, label text, num enumtest
);");
print_r(pg_convert($con,"e_test",array('id'=>11,'label'=>'fail','num'=>'gamma')));


Expected result:
----------------
some text starting with the word Array

Actual result:
--------------
nothing.

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

Reply via email to