Welcome Guest, Not a member yet? Register   Sign In
postgresql INSERT ... RETURNING and db->query()
#1

[eluser]Unknown[/eluser]
postgresql 8.2+ allows INSERT ... RETURNING ... queries, but db->query() does not return the results (only TRUE). query() should return the results just as SELECT does.

Temporarily I changed this line in DB_driver.php:
Code:
if ( ! preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql))
to this
Code:
if ( ! preg_match('/^\s*"?(SET|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql))
but I don't think this is right answer.

Dwayne


Messages In This Thread
postgresql INSERT ... RETURNING and db->query() - by El Forum - 08-18-2008, 09:48 PM
postgresql INSERT ... RETURNING and db->query() - by El Forum - 06-28-2013, 05:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB