Re: restore/dup OIDs HELP!

From: Jack Flak <jack(at)flak(dot)nospam(dot)org>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: restore/dup OIDs HELP!
Date: 2003-01-09 08:25:01
Message-ID: xlaT9.1566$Ca7.147782856@newssvr13.news.prodigy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Stephan,

That's very interesting! I didn't even know about these other "hidden"
fields. How many others are there?

You're right about the xmin value. It's the same for all the dups. That
could have saved me a lot of work. I built a perl script to locate the
dups, pull the data, re-insert it, and then delete by old OID.

What is the 'ctid' field about? It's wierd.
For that matter, what is 'xmin'???

Stephan Szabo wrote:

> On Sun, 5 Jan 2003, Jack Flak wrote:
>
>> Greetings Group,
>>
>> I'm running 7.1.
>>
>> Basically, my question is this: how do I delete an exact dup without
>> deleting the original?
>
> You can use one of the other hidden fields. ctid will be unique for the
> various rows, but I'm not sure of a good way to bulk delete them (tids
> don't seem to have comparison operators so the normal ways I can think of
> don't work).
>
> If all of the new rows were added by a single transaction (through copy
> say) you'd probably be able to delete all the rows added by that
> transaction using the xmin column. Find the xmin belonging to those rows
> and delete all the rows having that xmin.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jack Flak 2003-01-09 08:27:18 Re: restore/dup OIDs HELP!
Previous Message Raja Kumar Thatte 2003-01-09 04:10:29 Re: vaccumdb is giving "ERROR: out of free buffers: time to abort !"