mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-05 02:46:10 +02:00
Only connect to the database after having read both template and specific configuration
This commit is contained in:
parent
0426dcb4f0
commit
141d8ec19a
@ -101,6 +101,10 @@ class PGLoader:
|
||||
self.filename, self.input_encoding,
|
||||
self.table, self.columns)
|
||||
|
||||
# Now reset database connection
|
||||
if not DRY_RUN:
|
||||
self.db.reset()
|
||||
|
||||
if DEBUG:
|
||||
print '%s init done' % name
|
||||
print
|
||||
@ -529,10 +533,6 @@ class PGLoader:
|
||||
mesg = 'Configuration errors for section %s' % self.name
|
||||
raise PGLoader_Error, mesg
|
||||
|
||||
# Now reset database connection
|
||||
if not DRY_RUN:
|
||||
self.db.reset()
|
||||
|
||||
def _parse_fields(self, attr, str, btype = False, argtype = 'int'):
|
||||
""" parse the user string str for fields definition to store
|
||||
into self.attr """
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user