1--TEST-- 2PostgreSQL create large object with given oid 3--SKIPIF-- 4<?php 5include("skipif.inc"); 6$v = pg_version($conn); 7if (version_compare("8.3", $v["client"]) > 0) die("skip - requires pg client >= 8.3\n"); 8if (version_compare("8.3", $v["server"]) > 0) die("skip - requires pg server >= 8.3\n"); 9?> 10--FILE-- 11<?php 12 13include('config.inc'); 14 15$db = pg_connect($conn_str); 16 17echo "create LO from int\n"; 18pg_exec ($db, "begin"); 19$oid = pg_lo_create ($db, 21000); 20if (!$oid) echo ("pg_lo_create() error\n"); 21if ($oid != 21000) echo ("pg_lo_create() wrong id\n"); 22pg_lo_unlink ($db, $oid); 23pg_exec ($db, "commit"); 24 25echo "create LO from string\n"; 26pg_exec ($db, "begin"); 27$oid = pg_lo_create ($db, "21001"); 28if (!$oid) echo ("pg_lo_create() error\n"); 29if ($oid != 21001) echo ("pg_lo_create() wrong id\n"); 30pg_lo_unlink ($db, $oid); 31pg_exec ($db, "commit"); 32 33echo "create LO using default connection\n"; 34pg_exec ("begin"); 35$oid = pg_lo_create (21002); 36if (!$oid) echo ("pg_lo_create() error\n"); 37if ($oid != 21002) echo ("pg_lo_create() wrong id\n"); 38pg_lo_unlink ($oid); 39pg_exec ("commit"); 40 41echo "OK"; 42?> 43--EXPECT-- 44create LO from int 45create LO from string 46create LO using default connection 47OK 48