Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #!/path/to/interpreter
  4. #!/usr/bin/env python
  5.  
  6. import psycopg2
  7.  
  8. conn=psycopg2.connect(dbname='test',port=5433, password='123',user='ubuntu',host='localhost')
  9.  
  10. cur=conn.cursor()
  11.  
  12. cur.execute('''copy(select ID,d_name,d_fname,d_address from test) to '/tmp/test.csv' delimiter ';' csv header''')
  13.  
  14. print 'n'
  15.  
  16. print "ALL dONE"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement