Ganesh R
Ganesh R

Reputation: 123

Greenplum COPY not filtering duplicate entries

I have a problem loading contents to the green plum table using COPY command. What i have is three column table lets say A , B , C and the table should not entertain duplicate elements. So i have made a composite key clubbing the above three

PRIMARY KEY ( A , B , C )

But the input file which I am using to load the table, has duplicate entries. All I want is, the COPY command to filter off the duplicate elements and continue loading the data. But in my case whenever the COPY encounters a duplicate entry, it aborts the loading. Any leads on how to proceed??

Thanks

Ganesh.R

Upvotes: 0

Views: 300

Answers (1)

COPY doesn't work like that.

The first thing I'd try is the system sort.

sort -u old_filename > new_filename

The '-u' argument tells sort to output only unique lines.

Upvotes: 1

Related Questions