Postgres::getCasts PHP Method

getCasts() public method

Returns a list of all casts in the database
public getCasts ( ) : All
return All casts
    function getCasts()
    {
        global $conf;
        if ($conf['show_system']) {
            $where = '';
        } else {
            $where = '
				AND n1.nspname NOT LIKE $$pg\\_%$$
				AND n2.nspname NOT LIKE $$pg\\_%$$
				AND n3.nspname NOT LIKE $$pg\\_%$$
			';
        }
        $sql = "\n\t\t\tSELECT\n\t\t\t\tc.castsource::pg_catalog.regtype AS castsource,\n\t\t\t\tc.casttarget::pg_catalog.regtype AS casttarget,\n\t\t\t\tCASE WHEN c.castfunc=0 THEN NULL\n\t\t\t\tELSE c.castfunc::pg_catalog.regprocedure END AS castfunc,\n\t\t\t\tc.castcontext,\n\t\t\t\tobj_description(c.oid, 'pg_cast') as castcomment\n\t\t\tFROM\n\t\t\t\t(pg_catalog.pg_cast c LEFT JOIN pg_catalog.pg_proc p ON c.castfunc=p.oid JOIN pg_catalog.pg_namespace n3 ON p.pronamespace=n3.oid),\n\t\t\t\tpg_catalog.pg_type t1,\n\t\t\t\tpg_catalog.pg_type t2,\n\t\t\t\tpg_catalog.pg_namespace n1,\n\t\t\t\tpg_catalog.pg_namespace n2\n\t\t\tWHERE\n\t\t\t\tc.castsource=t1.oid\n\t\t\t\tAND c.casttarget=t2.oid\n\t\t\t\tAND t1.typnamespace=n1.oid\n\t\t\t\tAND t2.typnamespace=n2.oid\n\t\t\t\t{$where}\n\t\t\tORDER BY 1, 2\n\t\t";
        return $this->selectSet($sql);
    }
Postgres