Pivotal Knowledge Base

Follow

gptransfer fails with "too many values to unpack" due to period (.) in the table name

Environment

Pivotal Greenplum version below 4.3.6.0

Problem

gptransfer utility fails with the error message "too many values to unpack" , the error message looks like

20140801:12:37:32:013593 gptransfer:mdw:gpadmin-[INFO]:-Retrieving configuration of destination Greenplum Database...
20140801:12:37:32:013593 gptransfer:mdw:gpadmin-[INFO]:-Retrieving list of source tables...
20140801:12:37:32:013593 gptransfer:mdw:gpadmin-[CRITICAL]:-gptransfer failed. (Reason='too many values to unpack') exiting...

Or another varient of the error is

Traceback (most recent call last):
  File "/usr/local/GP-4.2.8.0/lib/python/gppylib/mainUtils.py", line 279, in simple_main_locked
    commandObject = createCommandFn(options, args)
  File "/usr/local/GP-4.2.8.0/bin/gptransfer", line 2154, in __init__
    self._options.source_port, self._options.source_user)
  File "/usr/local/GP-4.2.8.0/bin/gptransfer", line 608, in get_user_tables
    (schema, table) = row[0].split('.')
ValueError: too many values to unpack

Cause

The error is being printed due to failure from the below line of code of gptransfer , it attempts to splits the schemaname and table name separately with "." as its delimiter.

 607         for row in cur:
 608             (schema, table) = row[0].split('.')
 609             external = (row[1] == 'x')
 610             all_tables.add(GpTransferTable(database, schema, table, externa     l))
 611         cur.close()

But if there is a period or "." in the table name , the gptransfer fails to understand this and hence the issue

Use the below query to check if there any table name with periods or "." associated with its name in the source database

select relname from pg_class where relname like '%.%';

Solution

Upgrade to 4.3.6.0 where the issue is fixed.

Workaround

Rename the table name to something that doesn't have a period in its name.

alter table < schema-name >.< table-name > rename to < new-table-name >;

Comments

Powered by Zendesk