Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import pgdumplib
  2.  
  3. dump = pgdumplib.load('build/data/dump.compressed')
  4.  
  5. print('# Header: {}'.format(dump.toc.header))
  6. print('# Database: {}'.format(dump.toc.dbname))
  7. print('# Archive Timestamp: {}'.format(dump.toc.timestamp))
  8. print('# Server Version: {}'.format(dump.toc.server_version))
  9. print('# Dump Version: {}'.format(dump.toc.dump_version))
  10.  
  11. # convert=True will attempt to convert columns to native Python types
  12. for line in dump.read_data('test', 'users', convert=True):
  13. print(line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement