--- a/pgtoolkit/pgdatacopy.py Thu May 10 08:42:21 2012 +0200
+++ b/pgtoolkit/pgdatacopy.py Fri May 11 14:16:36 2012 +0200
@@ -28,7 +28,9 @@
class TargetNotEmptyError(Exception):
- pass
+ def __init__(self, msg, table):
+ Exception.__init__(self, msg)
+ self.table = table
class PgDataCopy:
@@ -74,7 +76,7 @@
curs.execute(q)
curs.connection.commit()
if curs.rowcount > 0:
- raise TargetNotEmptyError('Target table contains data: %s' % self.fulltable2)
+ raise TargetNotEmptyError('Target table contains data.', self.fulltable2)
self.cols = [desc[0] for desc in curs.description]
def read(self, tmpfile):