Re: Removing pg_migrator limitations - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Removing pg_migrator limitations
Date
Msg-id 200912240445.nBO4jBh16930@momjian.us
Whole thread Raw
In response to Re: Removing pg_migrator limitations  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Removing pg_migrator limitations  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian wrote:
> I looked at DefineEnum() and basically adding the ability to add enums
> would put the new enum after the existing ones unless the OID counter
> has wrapped around and is less than the oid counter at the time the enum
> type was created, in which case it will be listed as before the existing
> values.  I wasn't aware enum ordering is something we tried to maintain.
> One issue is that we are not supporting the addition of enum values even
> for people who don't care about the ordering of enums (which I bet might
> be the majority.)
> 
> I can think of a few approaches for pg_migrator:
> 
>     1)  Create an oid array in a permanent memory context and have
>         DefineEnum() read from that.
>     2)  Renumber the enum entries after they are created but before
>         any of their oids are stored in user tables.
> 
> Both can be done by pg_dump with proper server-side functions.  The
> problem with #2 are cases where the old and new oid ranges overlap,
> e.g.:

I now think the easiest solution will be to have pg_dump create the enum
with a single dummy value, delete the pg_enum dummy row, and then call a
modified version of EnumValuesCreate() to insert row by row into
pg_enum, with specified oids.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Backup history file should be replicated in Streaming Replication?
Next
From: Fujii Masao
Date:
Subject: Re: Streaming Rep - 2-phase backups and reducing time to full replication