pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Allowing ALTER TYPE to change storage strategy
Date: Thu, 5 Mar 2020 20:05:13 +0100
Message-ID: <20200305190513.y4j3ckkvpzrgiy2y@development> (raw)
In-Reply-To: <27393.1583366202@sss.pgh.pa.us>
References: <20200228004440.b23ein4qvmxnlpht@development>
	<4872.1582916389@sss.pgh.pa.us>
	<20200229012511.7h23frunvvxwai7q@development>
	<9226.1582940133@sss.pgh.pa.us>
	<10968.1583176270@sss.pgh.pa.us>
	<20200302220531.cdz4rlbw5gmcicsa@development>
	<30065.1583347198@sss.pgh.pa.us>
	<14527.1583363728@sss.pgh.pa.us>
	<27393.1583366202@sss.pgh.pa.us>

On Wed, Mar 04, 2020 at 06:56:42PM -0500, Tom Lane wrote:
>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.
>

Well, I don't know what to say, really. This very thread started with me
explaining how I've repeatedly needed a way to upgrade from PLAIN, so I
don't quite agree with your claim that there's no use case for that.

Granted, the cases may be my faults - sometimes I have not expected the
type to need TOAST initially, and then later realizing I've been wrong.
In other cases I simply failed to realize PLAIN is the default value
even for varlena types (yes, it's a silly mistake).

FWIW I'm not suggesting you go and implement #1 or #2 for me, that'd be
up to me I guess. But I disagree there's no use case for it, and #3
makes this featuer useless for me.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (20+ messages)  latest in thread

Message-ID: <20200305190513.y4j3ckkvpzrgiy2y@development>
Permalink:  ../20200305190513.y4j3ckkvpzrgiy2y@development/
Also on:    postgresql.org/message-id/20200305190513.y4j3ckkvpzrgiy2y@development

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, tgl@sss.pgh.pa.us
  Subject: Re: Allowing ALTER TYPE to change storage strategy
  In-Reply-To: <20200305190513.y4j3ckkvpzrgiy2y@development>
  References: <20200228004440.b23ein4qvmxnlpht@development> <4872.1582916389@sss.pgh.pa.us> <20200229012511.7h23frunvvxwai7q@development> <9226.1582940133@sss.pgh.pa.us> <10968.1583176270@sss.pgh.pa.us> <20200302220531.cdz4rlbw5gmcicsa@development> <30065.1583347198@sss.pgh.pa.us> <14527.1583363728@sss.pgh.pa.us> <27393.1583366202@sss.pgh.pa.us> <20200305190513.y4j3ckkvpzrgiy2y@development>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox