summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/subdrivers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-09-10 18:31:04 +0200
committerAndrey Andreev <narf@devilix.net>2013-09-10 18:31:04 +0200
commit4013be3d0953612ce081802bb6cc331338d8f58a (patch)
tree4a510c0d5f970c4183b8c060b7446ee57cc63ca9 /system/database/drivers/pdo/subdrivers
parentb61affdfeb37da0e97fc33a8ffe3ccabb0e47e04 (diff)
Add support for UPDATE ... RETURNING statements in PostgreSQL
An improved version of PR #2629. Also removes REPLACE from the regular expression, as it is not supported by PostgreSQL.
Diffstat (limited to 'system/database/drivers/pdo/subdrivers')
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
index 83daee9f6..285fca514 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
@@ -137,7 +137,7 @@ class CI_DB_pdo_pgsql_driver extends CI_DB_pdo_driver {
*/
public function is_write_type($sql)
{
- return (bool) preg_match('/^\s*"?(SET|INSERT(?![^\)]+\)\s+RETURNING)|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|REINDEX)\s+/i', $sql);
+ return (bool) preg_match('/^\s*"?(SET|INSERT(?![^\)]+\)\s+RETURNING)|UPDATE(?!.*\sRETURNING)|DELETE|CREATE|DROP|TRUNCATE|LOAD|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|REINDEX)\s+/i', $sql);
}
// --------------------------------------------------------------------