1
0
Fork 0
gnuviechadmin-historic/backend/psycopgtest.py
Jan Dittberner 36108b500f - make executable
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@104 a67ec6bc-e5d5-0310-a910-815c51eb3124
2005-09-19 18:55:40 +00:00

31 lines
601 B
Python

#!/usr/bin/env python
import psycopg
cnx = psycopg.connect("user=exim4 password=CotOgigmeIk5 dbname=gnuviechadmin")
cr = cnx.cursor()
print "-- Information from mailalias --"
cr.execute('SELECT * FROM mailalias')
cnx.commit()
print cr.description
result = cr.fetchall()
for line in result:
print line
print "-- Information from mailpasswd --"
cr.execute('SELECT * FROM mailpasswd')
cnx.commit()
result = cr.fetchall()
for line in result:
print line
print "-- Domains --"
cr.execute('SELECT DISTINCT domain FROM mailalias')
cnx.commit()
result = cr.fetchall()
for line in result:
print line