0
votes

I am using Amazon Redshift COPY command to insert new rows into a table.

The copy command fails and an error message coming up:

index "pg_toast_16408_index" is not a btree

I have noticed that the problem occurs because of description field that contains long string. When I try to copy without this field it works!

Does someone know why is that? How can I overcome this issue?

1
what is your copy command exactly (removing passwords etc)? how long is the target column "description" ? varchar(max)? what "constraints" do you have on the target table? please share your ddl for target table. (please can you update your question with this info?) - Jon Scott

1 Answers

0
votes

Use the TRUNCATECOLUMNS parameter:

Truncates data in columns to the appropriate number of characters so that it fits the column specification. Applies only to columns with a VARCHAR or CHAR data type, and rows 4 MB or less in size.