Re: Re: [Pg-migrator-general] Composite types break pg_migrated tables - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [Pg-migrator-general] Composite types break pg_migrated tables
Date
Msg-id 21205.1249524797@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: [Pg-migrator-general] Composite types break pg_migrated tables  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Re: [Pg-migrator-general] Composite types break pg_migrated tables
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> To allow pg_migrator to work, I would need to reserve the oids in
> pg_type, import the dump, and renumber the pg_type entries (and
> everything pointing to them) to the proper pg_type.oid.  The big problem
> there is that I don't have access at the SQL level to set or change
> oids. I am afraid the oid remumbering is something we would have to do
> in the backend by walking through the pg_depend entries for the pg_type
> row.  Yuck.

Renumbering type OIDs after-the-fact seems impossibly messy --- there's
not even any support in the backend for changing the OID of an existing
row, let alone any way to do it from the SQL level.  And you'd have to
find and fix all the references elsewhere in the system catalogs.  And
what about collisions?

ISTM the only reasonable way to deal with this would be to have some way
for pg_dump to emit commands to create types with specific OIDs.  While
we were at it, we might as well add the ability to specify toast-table
OIDs so as to get rid of the kluge that's doing that now.

At the moment it looks to me like pg_migrator has crashed and burned
for 8.4, at least for general-purpose usage.  We might be able to have
support for this stuff in 8.5.  But not being able to deal with any
user-defined types is too much of a restriction to make it of general
interest.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re: [Pg-migrator-general] Composite types break pg_migrated tables
Next
From: Andrew Dunstan
Date:
Subject: Re: Re: [Pg-migrator-general] Composite types break pg_migrated tables