Re: CLUSTER TODO item

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: CLUSTER TODO item
Date: 2001-09-23 13:58:47
Message-ID: 200109231358.f8NDwl708212@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Hi guys,
>
> I've been looking at CLUSTER today. I've put together a patch which
> recreates all the indices which current CLUSTER drops and copies relacl
> from the old pg_class tuple and puts it in the new one.
>
> I was working on updating pg_inherits to handle the new OID when it
> occured to me that pg_inherits is not the only system table
> corrupted. pg_trigger, pg_rewrite (and therefore views) and pg_description
> need to be updated as well. It seems like the easiest thing to do would be
> to update the new relation to have to OID of the old relation. Is there
> any reason why we would not want to do this?

We did strange things with this in the past because we didn't have
pg_class.relfilenode. Now that we do, you can just recreate the heap
table using a different oid filename and update relfilenode when you are
done. Keep the same oid. Of course, as you noted, the old indexes have
to be recreated because the heap has changed.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Michel POURE 2001-09-23 14:18:36 UTF-8 support
Previous Message Bruce Momjian 2001-09-23 13:55:45 Re: mutibyte aware functions