Description:
------------
If using the PDO driver with the pgsql driver it appears that the ini max memory limits are NOT obeyed while the driver fetches the results. This allows for a large query (ie select * from table) to go well above the memory limits that the php.ini specifies.
Expected result:
----------------
I would expect the PHP.ini memory limits to cause an out of memory limit/kill it if the amount of allocated space on the driver exceeds the configured memory limit.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

[2019-02-28 18:57 UTC] kontakt at beberlei dot de

I can understand your frustration with this, but it is not actually fixable unless there will be a complete implementation of the pgsql C client library using PHP/Zend APIs. This is what MySQL has with mysqlnd, as such this cannot happen with MySQL.
But Postgresql client library doesn't use PHPs memory management and goes around the memory limit for this reason.
As you can read here somebody requested the feature for libpq to replace the memory allocator, but nothing much has happened: https://www.postgresql.org/message-id/20170828172834.GA71455%40TC.local