Postgres::getAggregate PHP Method

getAggregate() public method

Gets all information for an aggregate
public getAggregate ( $name, $basetype ) : A
$name The name of the aggregate
$basetype The input data type of the aggregate
return A recordset
    function getAggregate($name, $basetype)
    {
        $c_schema = $this->_schema;
        $this->clean($c_schema);
        $this->fieldclean($name);
        $this->fieldclean($basetype);
        $sql = "\n\t\t\tSELECT p.proname, CASE p.proargtypes[0]\n\t\t\t\tWHEN 'pg_catalog.\"any\"'::pg_catalog.regtype THEN NULL\n\t\t\t\tELSE pg_catalog.format_type(p.proargtypes[0], NULL) END AS proargtypes,\n\t\t\t\ta.aggtransfn, format_type(a.aggtranstype, NULL) AS aggstype, a.aggfinalfn,\n\t\t\t\ta.agginitval, a.aggsortop, u.usename, pg_catalog.obj_description(p.oid, 'pg_proc') AS aggrcomment\n\t\t\tFROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n, pg_catalog.pg_user u, pg_catalog.pg_aggregate a\n\t\t\tWHERE n.oid = p.pronamespace AND p.proowner=u.usesysid AND p.oid=a.aggfnoid\n\t\t\t\tAND p.proisagg AND n.nspname='{$c_schema}'\n\t\t\t\tAND p.proname='" . $name . "'\n\t\t\t\tAND CASE p.proargtypes[0]\n\t\t\t\t\tWHEN 'pg_catalog.\"any\"'::pg_catalog.regtype THEN ''\n\t\t\t\t\tELSE pg_catalog.format_type(p.proargtypes[0], NULL)\n\t\t\t\tEND ='" . $basetype . "'";
        return $this->selectSet($sql);
    }
Postgres