Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRtUD-001szP-NI for pgsql-general@arkaria.postgresql.org; Thu, 11 Jul 2024 13:05:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sRtUA-00E2iY-Un for pgsql-general@arkaria.postgresql.org; Thu, 11 Jul 2024 13:05:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRtUA-00E2iQ-Ho for pgsql-general@lists.postgresql.org; Thu, 11 Jul 2024 13:05:22 +0000 Received: from fhigh2-smtp.messagingengine.com ([103.168.172.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRtU3-001YdL-5e for pgsql-general@lists.postgresql.org; Thu, 11 Jul 2024 13:05:21 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id D13361140FE8; Thu, 11 Jul 2024 09:05:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 11 Jul 2024 09:05:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1720703112; x= 1720789512; bh=uKgq7N0/4G3d4G5qH3irCNGFC21MbZiJ171HWKmXYmc=; b=P C7g30GPkxkPGPvMuQ8LALn6MG42YWaihV7JCWfYjn2NTCiuB3BkgBBr6UCV0Kibn s/2R3rMM0YLVKdpWmx5bOT/DnQuGs2aUl+G40IlHyssWsRNYFyWnQDTuD0W7FaNU 2MkRU5hYpw08Vrx+LdquHmh77dY5pxbEYG2pM8e04ZIp0cpvAGiORxWI0FRwFPDY 0/5p3KUSf2Mu3CwtBboG8ZQ5xaJ9xkOafn7ZolGljcKJ95DExar2Clh+8XPja2Mu LGjPvvjXf1pP5/auj3CvPOTYt0OHDFJqwKGozQyoWxFQ3aLSpFbDVmob1kqXeV5m S582x8PewLnVoxdAM7ayQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrfeeggdeiudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvfevuffkgggtugfgjgesthekre dttddtjeenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgv segrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepkedthfekveduue fgueelteekgfejgeekueduudeuveeuvddufffggfetiefhvdefnecuffhomhgrihhnpehp ohhsthhgrhgvshhqlhdrohhrghdpvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv segrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Jul 2024 09:05:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1720703109; bh=KzMbfMWbe89baKnV7uKJ1KlZ8k8PZHpdF7O76T8BWmE=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=YmvzZKj8rC1aZB6kKvoPMkj1kO3FQxMs7lfe1+itmNYffZOLX0+6NyUSAK73Fm1K2 zl3pVHC05y9p21kZhdhkyPMb/6kWn7qUxs/LSqqSBvNt/+3pYspMXGY+6UN8lMfZfp VpMcX7GMmmjydw1MegbE48dfC87rwQ0fqmW5uhozkAAwA2SelfWIMeXscU9EqYKe+/ wB8oelypVVLunpaAFa/hUD305HB+ehmVopvj4vVSoQKC4KwJYVEjKHap1UVqEo4iXG ynuAhcWiuXV5bZL1s+qRTOcBH4QwH3Z2MHkEtc6uAl9BnPl/BSxJoJvMu9qKifIZ8N mLUGCa/R5oYpQ== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 3DAC0529; Thu, 11 Jul 2024 15:05:09 +0200 (CEST) Date: Thu, 11 Jul 2024 15:05:09 +0200 From: Alvaro Herrera To: Ron Johnson Cc: pgsql-general Subject: Re: Dropping column from big table Message-ID: <202407111305.swxs3no6pmhy@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Jul-11, Ron Johnson wrote: > Anyway, DROP is the easy part; it's ADD COLUMN that can take a lot of time > (depending on whether or not you populate the column with a default value). Actually, ADD COLUMN with a default does not rewrite the entire table either, starting from pg11. "Major enhancements in PostgreSQL 11 include: [...] * Many other useful performance improvements, including the ability to avoid a table rewrite for ALTER TABLE ... ADD COLUMN with a non-null column default." https://www.postgresql.org/docs/11/release-11.html -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/