php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76616 PHP max memory limit not respected on pdo_pgsql
Submitted: 2018-07-12 12:01 UTC Modified: 2019-02-28 19:08 UTC
From: matttah at gmail dot com Assigned:
Status: Not a bug Package: PDO PgSQL
PHP Version: 7.1.19 OS: Ubuntu 16
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: matttah at gmail dot com
New email:
PHP Version: OS:

 

 [2018-07-12 12:01 UTC] matttah at gmail dot com
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

Add a Patch

Pull Requests

Add a Pull Request

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
 [2019-02-28 19:08 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2019-02-28 19:08 UTC] krakjoe@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri May 24 02:01:25 2019 UTC