 SELECT substring(datname, 5)::integer as dbnumber 
        FROM pg_database 
        WHERE datname LIKE 'ptdb%'
        ORDER BY dbnumber DESC 