/**
* Class to hold various commonly used functions
*
- * $Id: Misc.php,v 1.19 2003/03/27 13:47:15 chriskl Exp $
+ * $Id: Misc.php,v 1.20 2003/03/28 12:29:53 chriskl Exp $
*/
class Misc {
$version = $params[1]; // eg. 7.3.2
- if (strpos($version, '7.3') === 0)
+ if (strpos($version, '7.4') === 0)
+ return 'Postgres74';
+ elseif (strpos($version, '7.3') === 0)
return 'Postgres73';
elseif (strpos($version, '7.2') === 0)
return 'Postgres72';
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.33 2003/03/27 12:56:30 chriskl Exp $
+ * $Id: Postgres73.php,v 1.34 2003/03/28 12:29:53 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
// Last oid assigned to a system object
var $_lastSystemOID = 16974;
-
+
// Max object name length
var $_maxNameLen = 63;
$status = $this->beginTransaction();
if ($status != 0) return -1;
- $sql = "SELECT indrelid, indkey FROM pg_index WHERE indisprimary AND
+ $sql = "SELECT indrelid, indkey FROM pg_index WHERE indisunique AND
indrelid=(SELECT oid FROM pg_class WHERE relname='{$table}' AND
relnamespace=(SELECT oid FROM pg_catalog.pg_namespace WHERE nspname='{$this->_schema}'))";
$rs = $this->selectSet($sql);
/**
* List tables in a database
*
- * $Id: tables.php,v 1.10 2003/03/23 03:13:57 chriskl Exp $
+ * $Id: tables.php,v 1.11 2003/03/28 12:29:53 chriskl Exp $
*/
// Include application functions
if ($k == $localData->id && !$guiShowOIDs) continue;
elseif ($v == '') echo "<td class=\"data{$id}\"> </td>";
else echo "<td class=data{$id}>", nl2br(htmlspecialchars($v)), "</td>";
- }
+ }
if (sizeof($key) > 0) {
$key_str = '';
+ $has_nulls = false;
foreach ($key as $v) {
+ if ($rs->f[$v] === null) {
+ $has_nulls = true;
+ break;
+ }
if ($key_str != '') $key_str .= '&';
$key_str .= urlencode("key[{$v}]") . '=' . urlencode($rs->f[$v]);
}
-
- echo "<td class=opbutton{$id}><a href=\"{$PHP_SELF}?action=confeditrow&{$misc->href}&table=", urlencode($_REQUEST['table']), "&page=", $_REQUEST['page'], "&{$key_str}\">{$lang['stredit']}</a></td>\n";
- echo "<td class=opbutton{$id}><a href=\"{$PHP_SELF}?action=confdelrow&{$misc->href}&table=", urlencode($_REQUEST['table']), "&page=", $_REQUEST['page'], "&{$key_str}\">{$lang['strdelete']}</a></td>\n";
+ if ($has_nulls) {
+ echo "<td class=opbutton{$id}> </td>\n<td class=opbutton{$id}> </td>\n";
+ } else {
+ echo "<td class=opbutton{$id}><a href=\"{$PHP_SELF}?action=confeditrow&{$misc->href}&table=", urlencode($_REQUEST['table']), "&page=", $_REQUEST['page'], "&{$key_str}\">{$lang['stredit']}</a></td>\n";
+ echo "<td class=opbutton{$id}><a href=\"{$PHP_SELF}?action=confdelrow&{$misc->href}&table=", urlencode($_REQUEST['table']), "&page=", $_REQUEST['page'], "&{$key_str}\">{$lang['strdelete']}</a></td>\n";
+ }
}
echo "</tr>\n";
$rs->moveNext();