Re: [ADMIN] Problems with enums after pg_upgrade - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [ADMIN] Problems with enums after pg_upgrade
Date
Msg-id 50D1F45E.3060105@dunslane.net
Whole thread Raw
In response to Re: [ADMIN] Problems with enums after pg_upgrade  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [ADMIN] Problems with enums after pg_upgrade  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 12/19/2012 11:31 AM, Tom Lane wrote:
> enum_add is all right as long as you are careful to commit its
> transaction before inserting the new value anywhere.
>
>             

It's not really all right for post-9.0 versions. For example, this is wrong:

>     --postgres 9.2 or higher
>     IF version_int > 90200 THEN


It should really be "IF version_int >= 90100 THEN"

what is even worse is that this procedure doesn't take any care at all 
of the ordering rule for even numbered enum oids. We could have oid 
wraparound to an even numbered oid and it would break the rule.

cheers

andrew




pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Re: Set visibility map bit after HOT prune
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Cascading replication: should we detect/prevent cycles?