Skip site navigation (1) Skip section navigation (2)

Re: COPY-able csv log outputs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Smith <gsmith(at)gregsmith(dot)com>
Cc: FAST PostgreSQL <fastpgs(at)fast(dot)fujitsu(dot)com(dot)au>, pgsql-patches(at)postgresql(dot)org
Subject: Re: COPY-able csv log outputs
Date: 2007-05-21 03:47:50
Message-ID: 28137.1179719270@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Greg Smith <gsmith(at)gregsmith(dot)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

In response to

pgsql-patches by date

Next:From: dbDate: 2007-05-21 05:58:04
Subject: Re: UTF8MatchText
Previous:From: Andrew DunstanDate: 2007-05-21 03:22:53
Subject: Re: COPY-able csv log outputs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group