1
0
Fork 0

- Test for psycopg bindings

git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@103 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
Jan Dittberner 2005-09-19 18:40:21 +00:00
parent 96dc383526
commit f754b033fb

29
backend/psycopgtest.py Normal file
View file

@ -0,0 +1,29 @@
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