mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Build tablename and COPY column list only at COPY time, not for each line
This commit is contained in:
parent
b7c7e6a7c1
commit
d068b05ae2
@ -413,17 +413,6 @@ ORDER BY attnum
|
||||
ok = True
|
||||
if not self.copy: self.copy = True
|
||||
|
||||
##
|
||||
# build the table colomns specs from parameters
|
||||
# ie. we always issue COPY table (col1, col2, ..., coln) commands
|
||||
tablename = table
|
||||
if self.all_cols:
|
||||
table = table
|
||||
else:
|
||||
table = "%s (%s) " % (table, ", ".join(columnlist))
|
||||
|
||||
self.log.debug("COPY will use table definition: '%s'" % table)
|
||||
|
||||
if EOF or self.running_commands == self.copy_every \
|
||||
and self.buffer is not None:
|
||||
# time to copy data to PostgreSQL table
|
||||
@ -432,6 +421,17 @@ ORDER BY attnum
|
||||
self.log.warning("no data to COPY")
|
||||
return False
|
||||
|
||||
##
|
||||
# build the table colomns specs from parameters
|
||||
# ie. we always issue COPY table (col1, col2, ..., coln) commands
|
||||
tablename = table
|
||||
if self.all_cols:
|
||||
table = table
|
||||
else:
|
||||
table = "%s (%s) " % (table, ", ".join(columnlist))
|
||||
|
||||
self.log.debug("COPY will use table definition: '%s'" % table)
|
||||
|
||||
if CLIENT_MIN_MESSAGES <= logging.DEBUG:
|
||||
self.save_copy_buffer(tablename, debug = True)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user