Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- #!/path/to/interpreter
- #!/usr/bin/env python
- import psycopg2
- conn=psycopg2.connect(dbname='test',port=5433, password='123',user='ubuntu',host='localhost')
- cur=conn.cursor()
- cur.execute('''copy(select ID,d_name,d_fname,d_address from test) to '/tmp/test.csv' delimiter ';' csv header''')
- print 'n'
- print "ALL dONE"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement