diff options
author | Andrey Andreev <narf@devilix.net> | 2013-09-10 18:31:04 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2013-09-10 18:31:04 +0200 |
commit | 4013be3d0953612ce081802bb6cc331338d8f58a (patch) | |
tree | 4a510c0d5f970c4183b8c060b7446ee57cc63ca9 /system/database/drivers/postgre/postgre_driver.php | |
parent | b61affdfeb37da0e97fc33a8ffe3ccabb0e47e04 (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/postgre/postgre_driver.php')
-rw-r--r-- | system/database/drivers/postgre/postgre_driver.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index f24db46b4..010518ed3 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -318,7 +318,7 @@ class CI_DB_postgre_driver extends CI_DB { */ 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); } // -------------------------------------------------------------------- |