Re: COPY-able csv log outputs - Mailing list pgsql-patches

From Tom Lane
Subject Re: COPY-able csv log outputs
Date
Msg-id 28137.1179719270@sss.pgh.pa.us
Whole thread Raw
In response to Re: COPY-able csv log outputs  (Greg Smith <gsmith@gregsmith.com>)
List pgsql-patches
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

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: COPY-able csv log outputs
Next
From: db@zigo.dhs.org
Date:
Subject: Re: UTF8MatchText