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 1oBZbp-0004TL-KZ for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Jul 2022 10:28:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oBZbo-0003rN-Fx for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Jul 2022 10:28:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBZbo-0003oN-5n for pgsql-hackers@lists.postgresql.org; Wed, 13 Jul 2022 10:28:44 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBZbf-0003Vl-Lo for pgsql-hackers@postgresql.org; Wed, 13 Jul 2022 10:28:43 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id AEBD53200975; Wed, 13 Jul 2022 06:28:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 13 Jul 2022 06:28:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1657708113; x= 1657794513; bh=LlOHzTS9ci8lxwTTjkGsma7Xq8uvNtPM6ck30Ge7tB4=; b=h QClbVkTo1c8VFV4q+Zhc3b3nFkYo0HjkwUS2hm4rYsD0aOAbaiGNSEj5/cMhbHhD Y3DH2M43gZasQ6GTGP5Uvi7N9VrMKgvHVSWwpzGyMAehaMIUzXcau2d/cmB6ETVv 4kmNEoXSRayq3/y/Qibk58j9I3b2L3lvIrPz8PTOo0QWEF4uQF6CBCUHuPNZ1fkz BPP9+Bc4ibqDs7ROoBMdnjCi9C36xicEK2tjA459bdGOdygvKCMeQUpFxbUbzvtb Oo/9hkX6mRVsy9SGI+A9n8MpFZ0rN0aGL4on3YeoLOv0ZSdxGINtgI3lOi/qr3tN c51MnwRSEj9rVEvBI43AA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudejjedgvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnth gvrhhprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpedvveejgfejfeehfeeu ueekudelfffhjeejtddtleevieffuddvgefgteevjefhleenucffohhmrghinhepphhosh htghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvg gusgdrtghomh X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Jul 2022 06:28:31 -0400 (EDT) Message-ID: <46546823-5b6c-4aeb-43b8-d4db48d4a606@enterprisedb.com> Date: Wed, 13 Jul 2022 12:28:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: CREATE TABLE ( .. STORAGE ..) Content-Language: en-US To: Aleksander Alekseev , pgsql-hackers Cc: Matthias van de Meent , Teodor Sigaev , wenjing zeng References: <7166e46b-e718-3f3f-c165-ab321cc5dfaa@enterprisedb.com> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12.07.22 12:10, Aleksander Alekseev wrote: > Hi Peter, > >> The "safety check: do not allow toasted storage modes unless column >> datatype is TOAST-aware" could be moved into GetAttributeStorage(), so >> it doesn't have to be repeated. (Note that GetAttributeCompression() >> does similar checking.) > > Good point. Fixed. > >> ATExecSetStorage() currently doesn't do any such check, and your patch >> isn't adding one. Is there a reason for that? > > ATExecSetStorage() does this, but the check is a bit below [1]. In v7 > I moved the check to GetAttributeStorage() as well. > > [1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/commands/tablecmds.c#l8312 Committed. I thought the removal of the documentation details of SET COMPRESSION and SET STORAGE from the ALTER TABLE ref page was a bit excessive, since that material actually contained useful information about what happens when you change compression or storage on a table with existing data. So I left that in. Maybe there is room to deduplicate that material a bit, but it would need to be more fine-grained than just removing one side of it.