On Wed, Jan 28, 2009 at 5:00 PM, Zdenek Kotala <Zdenek.Kotala@sun.com> wrote:
> Tom Lane píše v st 28. 01. 2009 v 14:06 -0500:
>> Trying to do catalog upgrade
>> in-place is going to be a complete mess. I'd be interested to know,
>> for example, how you imagine rearranging the contents of pg_class would
>> work. You don't get to modify pg_class if you can't even find it, which
>> you can't because you can't read it.
>
> It is relatively easy. There are very high design:
>
> 1) upgrade move old catalog table into save location. We can create for
> example special tablespace for it
>
> 2) bootstrap creates catalog + create records for old catalog structure
>
> 3) data will be copied like
>
> INSERT INTO pg_class select from pg_upgrade.pg_class where oid>16...
>
> In reality it will be more complicated command but pure SQL.
I really like this idea, assuming I understand it. Basically, I think
you're proposing that we move the old system catalogs out of the way,
bootstrap a new catalog, and then using SQL (running inside a
standalone backend?) to migrate data from the old catalog to the new
one. That sounds really good to me. Even a relatively complicated
catalog reorganization should be able to be handled this way without
too much work or a lot of special-purpose code.
...Robert