summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/DB_driver.php2
-rw-r--r--system/database/drivers/postgre/postgre_utility.php6
-rw-r--r--user_guide_src/source/changelog.rst6
3 files changed, 6 insertions, 8 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index b41a42051..15195b20a 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -651,7 +651,7 @@ class CI_DB_driver {
*/
public function is_write_type($sql)
{
- return (bool) preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|OPTIMIZE)\s+/i', $sql);
+ return (bool) preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|OPTIMIZE|REINDEX)\s+/i', $sql);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php
index c175a382b..1e9580389 100644
--- a/system/database/drivers/postgre/postgre_utility.php
+++ b/system/database/drivers/postgre/postgre_utility.php
@@ -49,14 +49,12 @@ class CI_DB_postgre_utility extends CI_DB_utility {
/**
* Optimize table query
*
- * Is table optimization supported in Postgre?
- *
* @param string the table name
* @return string
*/
public function _optimize_table($table)
{
- return 'REINDEX TABLE '.$table;
+ return 'REINDEX TABLE '.$this->db->protect_identifiers($table);
}
// --------------------------------------------------------------------
@@ -64,8 +62,6 @@ class CI_DB_postgre_utility extends CI_DB_utility {
/**
* Repair table query
*
- * Are table repairs supported in Postgre?
- *
* @param string the table name
* @return bool
*/
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 6f3b030a0..cb33336a1 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -58,8 +58,10 @@ Release Date: Not Released
- Added an optional database name parameter to db_select().
- Replaced the _error_message() and _error_number() methods with error(), that returns an array containing the last database error code and message.
- Improved version() implementation so that drivers that have a native function to get the version number don't have to be defined in the core DB_driver class.
- - PostgreSQL driver now uses pg_version() to get the database version number, when possible.
- - Added db_set_charset() support for PostgreSQL.
+ - Improved support of the PostgreSQL driver, including:
+ - pg_version() is now used to get the database version number, when possible.
+ - Added db_set_charset() support.
+ - Added _optimize_table() support for the :doc:`Database Utility Class <database/utilities>` (rebuilds table indexes).
- Libraries