Is there a way to execute unbuffered queries against PostgreSQL from PHP, or at least limit the size of the local buffer that a driver uses?
Unfortunately there is not an unbuffered mode for the PHP pgsql extension or the pdo_pgsql extension. Flourish has an unbufferedQuery() method for fDatabase, but for PostgreSQL databases it uses the normal query functionality of the extensions.