From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Greg Stark <gsstark(at)mit(dot)edu>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
Subject: | Re: Removing pg_migrator limitations |
Date: | 2009-12-24 04:45:11 |
Message-ID: | 200912240445.nBO4jBh16930@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
From | Date | Subject | |
---|---|---|---|
Next Message | Fujii Masao | 2009-12-24 04:45:28 | Re: Streaming Rep - 2-phase backups and reducing time to full replication |
Previous Message | Fujii Masao | 2009-12-24 04:39:32 | Re: Backup history file should be replicated in Streaming Replication? |