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 1tol70-00EzAF-Hz for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Mar 2025 15:20:15 +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 1tol71-004arL-2b for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Mar 2025 15:20:13 +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 1tol70-004ar6-J6 for pgsql-hackers@lists.postgresql.org; Sun, 02 Mar 2025 15:20:13 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tol6u-000Xuu-2t for pgsql-hackers@postgresql.org; Sun, 02 Mar 2025 15:20:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1740928808; bh=HGdZb/MOoIxD6PTgGbPW4xhAL6qCQ+XyqKg4kIEulc0=; h=Message-ID:Date:User-Agent:Subject:To:References:From:In-Reply-To: From; b=0ag4EKX87Y+vbJKeVgDcmmCO8piNGrg4F4BDUKw4PjhazBQqFpSjkOAVOtLGRzJV8 6Vyx2u/3ps96m4sHLvFuN43BIJj/wPKOwuIiSlJK9mc3G6TE1DA4eE+ngcNfv6K73X ULNxMp+K8Aw3z3KrJ4mv3Gas2jPq0hi1tETl069fCELI4dEHBM/dUjOhCxu20gybQt yzn2XmR8gtEsou5uza0KZxus4PFjWt880zzhB7IZbmgow50TVoFqhiRlMzYjs38GUq 2kT1pObLXXmsqszgamZv/rxSOMRcNt4yYHwb0pNNCfQj7ikfN+E54yZz/lYFCW5BZc YzufxIPJtGzIw== Received: from [172.30.48.150] (unknown [172.30.48.150]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: y.sokolov@postgrespro.ru) by mail.postgrespro.ru (Postfix/465) with ESMTPSA id 71934600AC; Sun, 2 Mar 2025 18:20:08 +0300 (MSK) Message-ID: Date: Sun, 2 Mar 2025 18:20:07 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Allow table AMs to define their own reloptions To: Julien Tachoires , pgsql-hackers References: <20250302085641.hmjom5ru3w554t2n@poseidon.home.virt> <20250302132354.ffbfokeq36dp2kss@poseidon.home.virt> Content-Language: en-US From: Yura Sokolov In-Reply-To: <20250302132354.ffbfokeq36dp2kss@poseidon.home.virt> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-KSMG-AntiPhishing: NotDetected, bases: 2025/03/02 14:21:00 X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2025/03/02 13:37:00 #27538813 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 02.03.2025 16:23, Julien Tachoires пишет: > On Sun, Mar 02, 2025 at 09:56:41AM +0100, Julien Tachoires wrote: >> With the help of the new TAM routine 'relation_options', table access >> methods can with this patch define their own reloptions >> parser/validator. >> >> These reloptions can be set via the following commands: >> 1. CREATE TABLE ... USING table_am >> WITH (option1='value1', option2='value2'); >> 2. ALTER TABLE ... >> SET (option1 'value1', option2 'value2'); >> 3. ALTER TABLE ... SET ACCESS METHOD table_am >> OPTIONS (option1 'value1', option2 'value2'); >> >> When changing table's access method, the settings inherited from the >> former TAM can be dropped (if not supported by the new TAM) via: DROP >> option, or, updated via: SET option 'value'. >> >> Currently, tables using different TAMs than heap are able to use heap's >> reloptions (fillfactor, toast_tuple_target, etc...). With this patch >> applied, this is not the case anymore: if the TAM needs to have access >> to similar settings to heap ones, they have to explicitly define them. >> >> The 2nd patch file includes a new test module 'dummy_table_am' which >> implements a dummy table access method utilized to exercise TAM >> reloptions. This test module is strongly based on what we already have >> in 'dummy_index_am'. 'dummy_table_am' provides a complete example of TAM >> reloptions definition. >> >> This work is directly derived from SadhuPrasad's patch here [2]. Others >> attempts were posted here [1] and here [3]. >> >> [1] https://www.postgresql.org/message-id/flat/429fb58fa3218221bb17c7bf9e70e1aa6cfc6b5d.camel%40j-davis.com >> [2] https://www.postgresql.org/message-id/flat/CAFF0-CG4KZHdtYHMsonWiXNzj16gWZpduXAn8yF7pDDub+GQMg@mail.gmail.com >> [3] https://www.postgresql.org/message-id/flat/AMUA1wBBBxfc3tKRLLdU64rb.1.1683276279979.Hmail.wuhao%40hashdata.cn > > Please find a new version including minor fixes: 'TAM' terms are > replaced by 'table AM' Good day, Julien. Your forgot another one attempt discussion with patch [1] with alive commitfest entry [2] [1] https://postgr.es/m/flat/3766675.7eaCOWfIcx%40thinkpad-pgpro [2] https://commitfest.postgresql.org/patch/4688/ ------- regards Yura Sokolov aka funny-falcon