On Fri, Jun 26, 2009 at 7:38 AM, Ruzsinszky Attila <
> As we found there is a bug in my program.
> In some days ago the records arrived duplicated with some secs difference
> timestamp. (the difference can be 0s, too) Not all records are
> duplicated, because
> the problem is the first part of the input stream, so there are
> records which aren't
> How can I delete the records which arrived later?
> I would'nt like miss or drop the original records.
It is a little difficult to help you with only this information. How many
records are in your table? What is your primary key structure? Do you need
to delete them whilst the table is 'live', ie. records are constantly being
updated/inserted etc, or can you afford to just fix the records without
having to worry about the table being used for anything else?
You might be able to delete the records by using min(timestamp) to get the
earliest inserted records. You could push these into a temp copy of your
table, truncate the main table and then copy them back in from the temp
table. It would be easier to tell with more information about your data and
In response to
pgsql-novice by date
|Next:||From: Kindra Martinenko||Date: 2009-06-26 04:38:50|
|Subject: Re: Problems importing csv files|
|Previous:||From: Ruzsinszky Attila||Date: 2009-06-25 21:38:07|
|Subject: Duplicated records deleting between some secs|