Re: question about postgres persistent connection in php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



A majority of our sql statements in the logs are BEGIN; ROLLBACK; that is created by the php persistent connection and I want to see if I can get rid of them.

Try changing these lines:

        orig = PGG(ignore_notices);
        PGG(ignore_notices) = 1;
        res = PQexec(link,"BEGIN;");
        PQclear(res);
        res = PQexec(link,"ROLLBACK;");
        PQclear(res);
        PGG(ignore_notices) = orig;

to this:

if ((PQprotocolVersion(link) >= 3 && PQtransactionStatus(link) != PQTRANS_IDLE) || PQprotocolVersion(link) < 3)
        {
                orig = PGG(ignore_notices);
                PGG(ignore_notices) = 1;
                res = PQexec(link,"ROLLBACK;");
                PQclear(res);
                PGG(ignore_notices) = orig;
        }

And recompile.

Chris


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux