Re: --single-transaction hack to pg_upgrade does not work

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: --single-transaction hack to pg_upgrade does not work
Date: 2012-12-01 17:10:18
Message-ID: 20121201171018.GA31780@alap2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2012-12-01 12:00:46 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> >> The attached patch does just that. Its *not* ready yet though, as it
> >> will be apparent for everyone who reads it ;)
>
> ISTM this sort of thing ought to be safe enough, though you probably
> need to insist both that the pg_type row's xmin be current XID and
> that it not be HEAP_UPDATED.
>
> >> To really make that work in a reliable manner we would probably need
> >> an rd_createSubid for typcache entries instead of testing xmin as I have
> >> done here?
>
> What's more reliable about that? For one thing, cache entries can get
> flushed. The relcache goes to some lengths to hang onto rd_createSubid
> anyway, but I don't want to put equivalent logic into typcache.

I was concerned about updated rows but forgot about HEAP_UPDATED. So I
thought that it would be possible to alter the type in some generic
fashion (e.g. change owner) and then add new values.

The typecache variant would also have some hope of allowing some
intermediate changes to the type (like changing the type as above) in
the same transaction while still allowing to add new values.

But then, all that is not necessary for pg_upgrade.

Let me provide something a littlebit more mature.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-12-01 17:11:57 Re: --single-transaction hack to pg_upgrade does not work
Previous Message Andrew Dunstan 2012-12-01 17:08:23 Re: --single-transaction hack to pg_upgrade does not work