summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-12-06 12:04:01 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-12-06 12:04:01 +0100
commit40fab414fdfefeeef3da9bb87658f365c005bd2b (patch)
treeb6a8453dae3efbdab72d02f45256320ba3465158 /system/database/drivers
parentf9ff3afd28fbd5539a1081f25b83766369d78267 (diff)
parentc9fc88c09c1a0accdddd3710907fee2f5b42d7ad (diff)
Merge pull request #735 from tomasz154/develop
Made an "innocuous SQL statement" more innocuous SELECT * FROM was running in the PostgreSQL drivers just for the sake of returning valid SQL, which could of course be insanely slow on large tables.
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/postgre/postgre_forge.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php
index 166cc4e6a..df0338e73 100644
--- a/system/database/drivers/postgre/postgre_forge.php
+++ b/system/database/drivers/postgre/postgre_forge.php
@@ -81,9 +81,10 @@ class CI_DB_postgre_forge extends CI_DB_forge {
if ($if_not_exists === TRUE)
{
+ // PostgreSQL doesn't support IF NOT EXISTS syntax so we check if table exists manually
if ($this->db->table_exists($table))
{
- return "SELECT * FROM $table"; // Needs to return innocous but valid SQL statement
+ return TRUE;
}
}