* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.269 2005/08/03 06:34:01 chriskl Exp $
+ * $Id: Postgres.php,v 1.270 2005/08/10 05:50:52 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
SELECT DISTINCT
pa.amname,
po.opcname,
- (SELECT typname FROM pg_type t WHERE t.oid=opcintype) AS opcintype,
+ (SELECT typname FROM pg_type t WHERE t.oid=opcdeftype) AS opcintype,
TRUE AS opcdefault,
NULL::text AS opccomment
FROM
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres72.php,v 1.81 2005/08/01 05:31:32 chriskl Exp $
+ * $Id: Postgres72.php,v 1.82 2005/08/10 05:50:52 chriskl Exp $
*/
return $this->selectSet($sql);
}
+ // Opclass functions
+
+ /**
+ * Gets all opclasses
+ * @return A recordset
+ */
+ function getOpClasses() {
+ global $conf;
+
+ if ($conf['show_system'])
+ $where = '';
+ else
+ $where = "AND po.oid > '{$this->_lastSystemOID}'::oid";
+
+ $sql = "
+ SELECT DISTINCT
+ pa.amname,
+ po.opcname,
+ format_type(po.opcintype, NULL) AS opcintype,
+ TRUE AS opcdefault,
+ NULL::text AS opccomment
+ FROM
+ pg_opclass po, pg_am pa
+ WHERE
+ po.opcamid=pa.oid
+ {$where}
+ ORDER BY 1,2
+ ";
+
+ return $this->selectSet($sql);
+ }
+
// Administration functions
/**