Re: Allowing ALTER TYPE to change storage strategy

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allowing ALTER TYPE to change storage strategy
Date: 2020-03-04 23:56:42
Message-ID: 27393.1583366202@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> 3. Drop the ability for ALTER TYPE to promote from PLAIN to not-PLAIN
> typstorage, and adjust the typcache so that it only remembers boolean
> toastability not the specific toasting strategy. Then the cache is
> still immutable so no need for update logic.
>
> I'm kind of liking #3, ugly as it sounds, because I'm not sure how
> much of a use-case there is for the upgrade-from-PLAIN case.
> Particularly now that TOAST is so ingrained in the system, it seems
> rather unlikely that a production-grade data type wouldn't have
> been designed to be toastable from the beginning, if there could be
> any advantage to that. Either #1 or #2 seem like mighty high prices
> to pay for offering an option that might have no real-world uses.

Here's a v5 based on that approach. I also added some comments about
the potential race conditions involved in recursing to domains.

regards, tom lane

Attachment Content-Type Size
0001-simplify-CREATE-TYPE-1.patch text/x-diff 21.6 KB
0002-remove-remaining-traces-of-OPAQUE-1.patch text/x-diff 16.8 KB
0003-alter-type-v5.patch text/x-diff 50.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2020-03-05 00:00:58 Re: Allowing ALTER TYPE to change storage strategy
Previous Message Tom Lane 2020-03-04 23:15:28 Re: Allowing ALTER TYPE to change storage strategy