Derek Jones | 0b59f27 | 2008-05-13 04:22:33 +0000 | [diff] [blame^] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 2 | /**
|
| 3 | * CodeIgniter
|
| 4 | *
|
| 5 | * An open source application development framework for PHP 4.3.2 or newer
|
| 6 | *
|
| 7 | * @package CodeIgniter
|
Derek Allard | 3d879d5 | 2008-01-18 19:41:32 +0000 | [diff] [blame] | 8 | * @author ExpressionEngine Dev Team
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 9 | * @copyright Copyright (c) 2006, EllisLab, Inc.
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 10 | * @license http://codeigniter.com/user_guide/license.html
|
| 11 | * @link http://codeigniter.com
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 12 | * @since Version 1.0
|
| 13 | * @filesource
|
| 14 | */
|
| 15 |
|
| 16 | // ------------------------------------------------------------------------
|
| 17 |
|
| 18 | /**
|
| 19 | * Postgre Utility Class
|
| 20 | *
|
| 21 | * @category Database
|
Derek Allard | 3d879d5 | 2008-01-18 19:41:32 +0000 | [diff] [blame] | 22 | * @author ExpressionEngine Dev Team
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 23 | * @link http://codeigniter.com/user_guide/database/
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 24 | */
|
| 25 | class CI_DB_postgre_utility extends CI_DB_utility {
|
| 26 |
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 27 | /**
|
| 28 | * List databases
|
| 29 | *
|
| 30 | * @access private
|
| 31 | * @return bool
|
| 32 | */
|
| 33 | function _list_databases()
|
| 34 | {
|
| 35 | return "SELECT datname FROM pg_database";
|
| 36 | }
|
| 37 |
|
| 38 | // --------------------------------------------------------------------
|
| 39 |
|
| 40 | /**
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 41 | * Optimize table query
|
| 42 | *
|
| 43 | * Is table optimization supported in Postgre?
|
| 44 | *
|
| 45 | * @access private
|
| 46 | * @param string the table name
|
| 47 | * @return object
|
| 48 | */
|
| 49 | function _optimize_table($table)
|
| 50 | {
|
| 51 | return FALSE;
|
| 52 | }
|
| 53 |
|
| 54 | // --------------------------------------------------------------------
|
| 55 |
|
| 56 | /**
|
| 57 | * Repair table query
|
| 58 | *
|
| 59 | * Are table repairs supported in Postgre?
|
| 60 | *
|
| 61 | * @access private
|
| 62 | * @param string the table name
|
| 63 | * @return object
|
| 64 | */
|
| 65 | function _repair_table($table)
|
| 66 | {
|
| 67 | return FALSE;
|
| 68 | }
|
| 69 |
|
| 70 | // --------------------------------------------------------------------
|
| 71 |
|
| 72 | /**
|
| 73 | * Postgre Export
|
| 74 | *
|
| 75 | * @access private
|
| 76 | * @param array Preferences
|
| 77 | * @return mixed
|
| 78 | */
|
| 79 | function _backup($params = array())
|
| 80 | {
|
| 81 | // Currently unsupported
|
| 82 | return $this->db->display_error('db_unsuported_feature');
|
| 83 | }
|
| 84 |
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 85 | /**
|
| 86 | *
|
| 87 | * The functions below have been deprecated as of 1.6, and are only here for backwards
|
| 88 | * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation
|
| 89 | * is STRONGLY discouraged in favour if using dbforge.
|
| 90 | *
|
| 91 | */
|
| 92 |
|
| 93 | /**
|
| 94 | * Create database
|
| 95 | *
|
| 96 | * @access private
|
| 97 | * @param string the database name
|
| 98 | * @return bool
|
| 99 | */
|
| 100 | function _create_database($name)
|
| 101 | {
|
| 102 | return "CREATE DATABASE ".$name;
|
| 103 | }
|
| 104 |
|
| 105 | // --------------------------------------------------------------------
|
| 106 |
|
| 107 | /**
|
| 108 | * Drop database
|
| 109 | *
|
| 110 | * @access private
|
| 111 | * @param string the database name
|
| 112 | * @return bool
|
| 113 | */
|
| 114 | function _drop_database($name)
|
| 115 | {
|
| 116 | return "DROP DATABASE ".$name;
|
| 117 | }
|
| 118 |
|
| 119 |
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 120 | }
|
| 121 |
|
Derek Jones | 0b59f27 | 2008-05-13 04:22:33 +0000 | [diff] [blame^] | 122 |
|
| 123 | /* End of file postgre_utility.php */
|
Derek Jones | a3ffbbb | 2008-05-11 18:18:29 +0000 | [diff] [blame] | 124 | /* Location: ./system/database/drivers/postgre/postgre_utility.php */ |