Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jADFK-000294-TQ for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Mar 2020 13:42:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jADFI-00026S-LL for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Mar 2020 13:42:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jADFI-00026L-8k for pgsql-hackers@lists.postgresql.org; Fri, 06 Mar 2020 13:42:32 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jADFA-0002CO-S9 for pgsql-hackers@postgresql.org; Fri, 06 Mar 2020 13:42:30 +0000 Received: by mail-wm1-x32d.google.com with SMTP id i14so2434762wmb.1 for ; Fri, 06 Mar 2020 05:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FP7EtnM8h1zI9Bi2zrEWptcrjiIw+d20TpbhqZpiVCs=; b=dSoIpxmD69LNwUxIuihe9iKUXRcROhPz5GKnChI3QwGlVzVEtlGOgcGwWALkYYg8FC Gk9xv2AJznxIQdjK3ruNiUC81KwdYgbj47kpUJpN7ij30LJrl2gTOY4Zij018e94kEPh 6KRSCA2fywDVzg6BNiPSUSlGAsvX4GTSvpS6fWKaZD9I+Llt50Ttfmlk5DwDF2V5BUrZ PdGivzNhVrFgqPyZMANRCE0I0wLVutWw3nhSZEapjneLdeM30z6TX5mxmQCpm5lKuN7S cESeE6GiId95Qz06MPnWNgtlDC73Z6+XaulHmMKucY6+ZLO6ZJFelpNUrYEs26rHw5lX ur/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FP7EtnM8h1zI9Bi2zrEWptcrjiIw+d20TpbhqZpiVCs=; b=B7ciEg8DzNMZTUQQQkE9e4wxxjndpmQyd0Cba2ltD1Ph4QxcKca+3g6cJ91VUNAwQ0 JgSwimacNITS7ACQFAiM+hOtfYVSZWQVFvjkWmYHJDga11jGL/ynBAkPQMkzgDpqdzx8 nB+0Idpdw7Zhaex12c3HNgi/GDMlMSGfcGbk7B7OxjU+tvz/W1RRcAPde7v5g6fDWAgx v8oQfj8fZFXjyW6IK20/8f829U+hSod4gYbotc3c4dLCwr/uIAkGzsyebphUhl1wBQ0P GE0aKq0kqH5juyluQLnbkqxQXICpNXUbrDvgkrG9pidfdEJ5qZRT4aipIRddzLoUaSne MOMg== X-Gm-Message-State: ANhLgQ2gxV4jLLgEfAzvmuqfs5iqKAvHuuV7j+0J7/RaoEEKkVtSrBNx /nJzssQW/WzMjbnGkp21UJPKA8bz50A= X-Google-Smtp-Source: ADFU+vtRn0SbH20jJHTorNojim7lI0nr36hCAkVkPR/Oc2IYVCB2N/xPRGD5/SdwWKjdSKFCUbVNrQ== X-Received: by 2002:a1c:4b0d:: with SMTP id y13mr4200970wma.4.1583502143087; Fri, 06 Mar 2020 05:42:23 -0800 (PST) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id u8sm4135734wrn.69.2020.03.06.05.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2020 05:42:20 -0800 (PST) Date: Fri, 6 Mar 2020 14:42:18 +0100 From: Tomas Vondra To: Tom Lane Cc: pgsql-hackers@postgresql.org Subject: Re: Allowing ALTER TYPE to change storage strategy Message-ID: <20200306134218.rgcaddnbcudcu5hm@development> References: <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> <17431.1583437964@sss.pgh.pa.us> <13399.1583448404@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <13399.1583448404@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Mar 05, 2020 at 05:46:44PM -0500, Tom Lane wrote: >I wrote: >> If not, we probably should bite the bullet and go for #1, since >> I have little doubt that we'll need that someday anyway. >> The trick will be to keep down the cache invalidation overhead... > >Here's a version that does it like that. I'm less worried about the >overhead than I was before, because I realized that we already had >a syscache callback for pg_type there. And it was being pretty >stupid about which entries it reset, too, so this version might >actually net out as less overhead (in some workloads anyway). > >For ease of review I just added the new TCFLAGS value out of >sequence, but I'd be inclined to renumber the bits back into >sequence before committing. > LGTM. If I had to nitpick, I'd say that the example in docs should be ALTER TYPE mytype SET ( SEND = mytypesend, RECEIVE = mytyperecv ); i.e. with uppercase SEND/RECEIVE, because that's how we spell it in other examples in CREATE TYPE etc. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services