ID: 25093
User updated by: php at pv2c dot sk
-Reported By: pvx at pv2c dot sk
+Reported By: php at pv2c dot sk
Status: Open
Bug Type: PostgreSQL related
Operating System: Linux
PHP Version: 4.3.2
New Comment:
Sorry :), correct SQL in pg_query should be:
"INSERT INTO aaa (test) VALUES (1);"
Previous Comments:
------------------------------------------------------------------------
[2003-08-14 06:51:01] php at pv2c dot sk
Description:
------------
pg_query doesn't return resource for failed queries - that's not very
wise, IMHO (see related bug 18747), but the real problem with this is,
that you cannot free failed results.
It may not be noticeable if you have only a few failed queries, but it
becomes a serious problem if you have lots. Try the example code.
Reproduce code:
---------------
// assume one table "aaa" with one column "test", that is
// unique (primary key maybe)
$con=pg_connect(...);
for($t=0; $t<10000; $t++)
{
$ret = pg_query($con, "INSERT INTO aaa (test) VALUES 1");
// $ret is FALSE (cannot inset duplicate value) => no way to free it
}
Expected result:
----------------
Some way to free the result resource...
Actual result:
--------------
PHP memory consumption grows *really fast*, in my case it even ignores
memory_limit setting in php.ini.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25093&edit=1