Greg Smith <gsmith@gregsmith.com> writes:
> The most fundamental issue I have with the interface is that using COPY
> makes it difficult to put any unique index on the resulting table. I like
> to have a unique index on my imported log table because it rejects the
> dupe records if you accidentally import the same section of log file
> twice. COPY tosses the whole thing if there's an index violation, which
> is a problem during a regular import because you will occasionally come
> across lines with the same timestamp that are similar in every way except
> for their statment; putting an index on the timestamp+statement seems
> impractical.
Essentially the above is arguing that you want a unique index but you
can't be bothered to invent an actually-unique key. This doesn't seem
a sound argument to me. If we need a unique key, let's find one.
regards, tom lane