Re: [ADMIN] Problems with enums after pg_upgrade

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Bernhard Schrader <bernhard(dot)schrader(at)innogames(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [ADMIN] Problems with enums after pg_upgrade
Date: 2012-12-19 17:07:42
Message-ID: 50D1F45E.3060105@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2012-12-19 17:08:59 Re: Cascading replication: should we detect/prevent cycles?
Previous Message Pavan Deolasee 2012-12-19 16:49:25 Re: Set visibility map bit after HOT prune