Features
* Add CACHE and CYCLE parameters in sequence creation
* View, add, edit and delete comments on views, schemas and columns (Dan Boren)
+* Allow creating array columns in tables
Bugs
* Fix pg_dump output for PostgreSQL 7.0.x and 7.1.x
+* In 7.4 pg_dump, specify schema when dumping tables
Version 3.3.1
-------------
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: BaseDB.php,v 1.41 2004/03/06 11:30:00 chriskl Exp $
+ * $Id: BaseDB.php,v 1.42 2004/03/29 02:05:31 chriskl Exp $
*/
include_once('./classes/database/ADODB_base.php');
function hasVariables() { return false; }
function hasFullExplain() { return false; }
function hasStatsCollector() { return false; }
+ function hasSchemaDump() { return false; }
}
?>
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.186 2004/03/12 08:56:53 chriskl Exp $
+ * $Id: Postgres.php,v 1.187 2004/03/29 02:05:31 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
* @param $fields The number of fields
* @param $field An array of field names
* @param $type An array of field types
+ * @param $array An array of '' or [] for each type if it's an array or not
* @param $length An array of field lengths
* @param $notnull An array of not null
* @param $default An array of default values
* @return 0 success
* @return -1 no fields supplied
*/
- function createTable($name, $fields, $field, $type, $length, $notnull, $default, $withoutoids, $colcomment, $tblcomment) {
+ function createTable($name, $fields, $field, $type, $array, $length, $notnull,
+ $default, $withoutoids, $colcomment, $tblcomment) {
$this->fieldClean($name);
$this->fieldClean($tblcomment);
$sql .= "\"{$field[$i]}\" {$type[$i]}";
if ($length[$i] != '') $sql .= "({$length[$i]})";
}
-
+ // Add array qualifier if necessary
+ if ($array[$i] == '[]') $sql .= '[]';
+ // Add other qualifiers
if (isset($notnull[$i])) $sql .= " NOT NULL";
if ($default[$i] != '') $sql .= " DEFAULT {$default[$i]}";
if ($i != $fields - 1) $sql .= ", ";
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres74.php,v 1.25 2004/03/12 08:56:54 chriskl Exp $
+ * $Id: Postgres74.php,v 1.26 2004/03/29 02:05:31 chriskl Exp $
*/
include_once('./classes/database/Postgres73.php');
function hasGrantOption() { return true; }
function hasDomainConstraints() { return true; }
function hasUserRename() { return true; }
+ function hasSchemaDump() { return true; }
}
* Does an export to the screen or as a download. This checks to
* see if they have pg_dump set up, and will use it if possible.
*
- * $Id: dataexport.php,v 1.11 2004/01/29 07:30:11 chriskl Exp $
+ * $Id: dataexport.php,v 1.12 2004/03/29 02:05:31 chriskl Exp $
*/
$extensions = array(
$url = 'dbexport.php?database=' . urlencode($_REQUEST['database']);
$url .= '&what=' . urlencode($_REQUEST['what']);
$url .= '&table=' . urlencode($_REQUEST['table']);
+ $url .= '&schema=' . urlencode($_REQUEST['schema']);
$url .= '&d_format=' . urlencode($_REQUEST['d_format']);
$url .= '&output=' . urlencode($_REQUEST['output']);
if (isset($_REQUEST['d_oids'])) $url .= '&d_oids=' . urlencode($_REQUEST['d_oids']);
$url = 'dbexport.php?database=' . urlencode($_REQUEST['database']);
$url .= '&what=' . urlencode($_REQUEST['what']);
$url .= '&table=' . urlencode($_REQUEST['table']);
+ $url .= '&schema=' . urlencode($_REQUEST['schema']);
$url .= '&output=' . urlencode($_REQUEST['output']);
if (isset($_REQUEST['s_clean'])) $url .= '&s_clean=' . urlencode($_REQUEST['s_clean']);
$url .= "&" . SID;
$url = 'dbexport.php?database=' . urlencode($_REQUEST['database']);
$url .= '&what=' . urlencode($_REQUEST['what']);
$url .= '&table=' . urlencode($_REQUEST['table']);
+ $url .= '&schema=' . urlencode($_REQUEST['schema']);
$url .= '&sd_format=' . urlencode($_REQUEST['sd_format']);
$url .= '&output=' . urlencode($_REQUEST['output']);
if (isset($_REQUEST['sd_clean'])) $url .= '&sd_clean=' . urlencode($_REQUEST['sd_clean']);
* Does an export of a database or a table (via pg_dump)
* to the screen or as a download.
*
- * $Id: dbexport.php,v 1.9 2004/03/14 06:55:53 chriskl Exp $
+ * $Id: dbexport.php,v 1.10 2004/03/29 02:05:31 chriskl Exp $
*/
// Include application functions
$_no_output = true;
include_once('./libraries/lib.inc.php');
-
+
// Check that database dumps are enabled.
if ($misc->isDumpEnabled()) {
// Check for a table specified
if (isset($_REQUEST['table'])) {
$cmd .= " -t " . escapeshellarg($_REQUEST['table']);
+ // If we are 7.4 or higher, assume they are using 7.4 pg_dump and
+ // set dump schema as well.
+ if ($data->hasSchemaDump()) {
+ $cmd .= " -n " . escapeshellarg($_REQUEST['schema']);
+ }
}
// Check for GZIP compression specified
/**
* List tables in a database
*
- * $Id: tables.php,v 1.45 2004/03/12 08:56:51 chriskl Exp $
+ * $Id: tables.php,v 1.46 2004/03/29 02:05:31 chriskl Exp $
*/
// Include application functions
$misc->printVal($typname), "</option>\n";
$types->moveNext();
}
- echo "</select></td>";
+ echo "</select>";
+
+ // Output array type selector
+ echo "<select name=\"array[{$i}]\">\n";
+ echo "<option value=\"\"", (isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '') ? ' selected="selected"' : '', "></option>\n";
+ echo "<option value=\"[]\"", (isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '[]') ? ' selected="selected"' : '', ">[ ]</option>\n";
+ echo "</select></td>\n";
+
echo "<td><input name=\"length[{$i}]\" size=\"10\" value=\"",
htmlspecialchars($_REQUEST['length'][$i]), "\" /></td>";
echo "<td><input type=\"checkbox\" name=\"notnull[{$i}]\"", (isset($_REQUEST['notnull'][$i])) ? ' checked="checked"' : '', " /></td>";
}
$status = $data->createTable($_REQUEST['name'], $_REQUEST['fields'], $_REQUEST['field'],
- $_REQUEST['type'], $_REQUEST['length'], $_REQUEST['notnull'], $_REQUEST['default'],
+ $_REQUEST['type'], $_REQUEST['array'], $_REQUEST['length'], $_REQUEST['notnull'], $_REQUEST['default'],
isset($_REQUEST['withoutoids']), $_REQUEST['colcomment'], $_REQUEST['tblcomment']);
if ($status == 0) {
$_reload_browser = true;