Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leoIK-0002L8-Lx for pgsql-hackers@arkaria.postgresql.org; Fri, 07 May 2021 00:24:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1leoII-0005C8-R5 for pgsql-hackers@arkaria.postgresql.org; Fri, 07 May 2021 00:24:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leoII-0005C0-Db for pgsql-hackers@lists.postgresql.org; Fri, 07 May 2021 00:24:38 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1leoIB-0007Zl-FO for pgsql-hackers@postgresql.org; Fri, 07 May 2021 00:24:37 +0000 Received: by mail-pl1-x62f.google.com with SMTP id s20so4250903plr.13 for ; Thu, 06 May 2021 17:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=NuWMpk+kbeZ4czW62Mtvv73oezMSfd3y53xDyMoh6Cg=; b=pASO5EWL69zJotaHTdIGv46LtSvUy/TV6w5O47NpgfGcBO3aAEM992zBCGA7aU+Hxf 8jws/048RCmlpztWL2KKbbqsqDtlZN7AyIZwiovRj+gufjqKEl2f1VUYVKfl01ui9z0V SopSGIE7t3TsBEQw2VEsNGT0+W6A2hMQeh6lDtI79HsHxMBbnaT8QR0p+LsCUJSnuwjk iak9JiEdcppkB99RJufaz/FdEwDIIoQ4uGxmiihDhmi9/AEZgWiY3nJLvQe4dYWobZM1 JF4T8+xRKJKjy86vFY831icpZNB2wnTJ9Mo0m7fuvu8LeA+ovIoKV2OOMArOdu2EhLco BWZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=NuWMpk+kbeZ4czW62Mtvv73oezMSfd3y53xDyMoh6Cg=; b=FP7gh8WNc8V8HCAZxp2HCap/u1dM19TqITSTy50Zmb/AeQf84oxeDxQQMa5XAKlEz6 7fcAPSZqVp1bspk5MAXyEgdqSPZajrATAkQPO/OW5r0HEz2pCUMZLkZdPcou502O3BRZ 1vMOdDW5wYHc9FalvhGOyKVd5s3iB4ZMoyN0sk4xEG1DEmgQ8EuKeGZM82dhsbt1V9St KtpPz8WMJRa4lNj5s+sCMLjWHiPfh+MKBNjTeEn+hSpqmFzn8wf+unialfAzSYYkLj7O wrfr5HzaEV1bkJVAkluXseKoVbpaCfRDG0RJujkJwzhje6dEEt20k0IIyRMo4jyynZ4W Y72Q== X-Gm-Message-State: AOAM530Jsf6x1zVzh1p9TlrMpQIiUnniai/DVVgTHElIh9byWogJ9jcj Nw7n5xzDXVEFiakYxJ6dNK7cOw== X-Google-Smtp-Source: ABdhPJxNqk8AK/QP2ibvT95qe3bVEQyoHGihLe4y/mSL7XXYPd+zJYasJlvZsSGnoXP1Lyx6M3JWYA== X-Received: by 2002:a17:90a:1382:: with SMTP id i2mr20234881pja.83.1620347068660; Thu, 06 May 2021 17:24:28 -0700 (PDT) Received: from jdavis.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id a24sm2816860pgv.76.2021.05.06.17.24.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 May 2021 17:24:28 -0700 (PDT) Message-ID: <3bee08c2ca0fab15d14899afcb19490f29e0ec6f.camel@j-davis.com> Subject: Re: alter table set TABLE ACCESS METHOD From: Jeff Davis To: Justin Pryzby Cc: Michael Paquier , pgsql-hackers@postgresql.org, Jacob Champion , Heikki Linnakangas , Ashwin Agrawal , Ashutosh Sharma , Andres Freund , Robert Haas , Amit Kapila , Alvaro Herrera , Dilip Kumar Date: Thu, 06 May 2021 17:24:25 -0700 In-Reply-To: <20210506221943.GS27406@telsasoft.com> References: <20210228222530.GD20769@telsasoft.com> <20210308010707.GA29832@telsasoft.com> <35333ea26e52252174515e14671a9fbc1c20c8fa.camel@j-davis.com> <20210506202305.GQ27406@telsasoft.com> <1033d6b4b5b42a014cc3f617265ae6e61cb5781b.camel@j-davis.com> <20210506221943.GS27406@telsasoft.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2021-05-06 at 17:19 -0500, Justin Pryzby wrote: > If ATRewriteTable didn't > handle this, > data would become inaccessible if an AM failed to de-toast tuples. If the AM fails to detoast tuples, it's got bigger problems than ALTER TABLE. What about INSERT INTO ... SELECT? It's the table AM's responsibility to detoast out-of-line datums and toast any values that are too large (see heapam.c:heap_prepare_insert()). Regards, Jeff Davis