Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- query = "select relname, pg_total_relation_size(oid) as size from pg_class where relname like 'f.%." + match.group(1) + "[%]' order by relname asc"
- cursor.execute( query )
- records = cursor.fetchall()
- # item[0] - relation name, item[1] - relation size
- for item in records:
- size = round(float(item[1])/1024/1024, 2)
- query2 = 'select max(id) as id from "' + item[0] + '"';
- cursor.execute( query2 )
- records2 = cursor.fetchall()
- for item2 in records2:
- print item2
Add Comment
Please, Sign In to add comment