functions query.
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.254 2005/02/20 04:47:46 mr-russ Exp $
+ * $Id: Postgres.php,v 1.254.2.1 2005/03/01 10:33:24 jollytoad Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
* @return A list of databases, sorted alphabetically
*/
function &getDatabases($currentdatabase = NULL) {
- global $conf;
+ global $conf, $misc;
- if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($_SESSION['webdbUsername'])) {
- $username = $_SESSION['webdbUsername'];
+ $server_info = $misc->getServerInfo();
+
+ if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($server_info['username'])) {
+ $username = $server_info['username'];
$this->clean($username);
$clause = " AND pu.usename='{$username}'";
}
pt.typname AS proresult,
pl.lanname AS prolanguage,
oidvectortypes(pc.proargtypes) AS proarguments,
- (SELECT description FROM pg_description pd WHERE pc.oid=pd.objoid) AS procomment
+ (SELECT description FROM pg_description pd WHERE pc.oid=pd.objoid) AS procomment,
+ proname || ' (' || proarguments || ')' AS proproto,
+ CASE WHEN proretset THEN 'setof ' ELSE '' END || pt.typname AS proreturns
FROM
pg_proc pc, pg_user pu, pg_type pt, pg_language pl
WHERE
proretset,
'OPAQUE' AS proresult,
oidvectortypes(pc.proargtypes) AS proarguments,
- (SELECT description FROM pg_description pd WHERE pc.oid=pd.objoid) AS procomment
+ (SELECT description FROM pg_description pd WHERE pc.oid=pd.objoid) AS procomment,
+ proname || ' (' || proarguments || ')' AS proproto,
+ CASE WHEN proretset THEN 'setof ' ELSE '' END || 'OPAQUE' AS proreturns
FROM
pg_proc pc, pg_user pu, pg_type pt
WHERE
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres71.php,v 1.70 2005/02/06 20:03:20 soranzo Exp $
+ * $Id: Postgres71.php,v 1.70.2.1 2005/03/01 10:33:23 jollytoad Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
* @return A list of databases, sorted alphabetically
*/
function &getDatabases($currentdatabase = NULL) {
- global $conf;
-
- if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($_SESSION['webdbUsername'])) {
- $username = $_SESSION['webdbUsername'];
+ global $conf, $misc;
+
+ $server_info = $misc->getServerInfo();
+
+ if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($server_info['username'])) {
+ $username = $server_info['username'];
$this->clean($username);
$clause = " AND pu.usename='{$username}'";
}
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres72.php,v 1.78 2004/11/10 01:46:36 chriskl Exp $
+ * $Id: Postgres72.php,v 1.78.4.1 2005/03/01 10:33:23 jollytoad Exp $
*/
false AS proretset,
format_type(p.prorettype, NULL) AS proresult,
oidvectortypes(p.proargtypes) AS proarguments,
- (SELECT description FROM pg_description pd WHERE p.oid=pd.objoid) AS procomment
+ (SELECT description FROM pg_description pd WHERE p.oid=pd.objoid) AS procomment,
+ p.proname || ' (' || oidvectortypes(p.proargtypes) || ')' AS proproto,
+ format_type(p.prorettype, NULL) AS proreturns
FROM
pg_proc p
WHERE
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.142 2004/12/06 02:48:34 chriskl Exp $
+ * $Id: Postgres73.php,v 1.142.2.1 2005/03/01 10:33:24 jollytoad Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
pg_catalog.format_type(p.prorettype, NULL) AS proresult,
pg_catalog.oidvectortypes(p.proargtypes) AS proarguments,
pl.lanname AS prolanguage,
- pg_catalog.obj_description(p.oid, 'pg_proc') AS procomment
+ pg_catalog.obj_description(p.oid, 'pg_proc') AS procomment,
+ p.proname || ' (' || pg_catalog.oidvectortypes(p.proargtypes) || ')' AS proproto,
+ CASE WHEN p.proretset THEN 'setof ' ELSE '' END || pg_catalog.format_type(p.prorettype, NULL) AS proreturns
FROM pg_catalog.pg_proc p
INNER JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace
INNER JOIN pg_catalog.pg_language pl ON pl.oid = p.prolang
/**
* PostgreSQL 8.0 support
*
- * $Id: Postgres80.php,v 1.10 2005/02/06 00:34:20 mr-russ Exp $
+ * $Id: Postgres80.php,v 1.10.2.1 2005/03/01 10:33:24 jollytoad Exp $
*/
include_once('./classes/database/Postgres74.php');
* @return A list of databases, sorted alphabetically
*/
function &getDatabases($currentdatabase = NULL) {
- global $conf;
-
- if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($_SESSION['webdbUsername'])) {
- $username = $_SESSION['webdbUsername'];
+ global $conf, $misc;
+
+ $server_info = $misc->getServerInfo();
+
+ if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser($server_info['username'])) {
+ $username = $server_info['username'];
$this->clean($username);
$clause = " AND pu.usename='{$username}'";
}