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 1mxDU1-0002qq-Ig for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Dec 2021 19:29:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxDU0-0005vn-6V for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Dec 2021 19:29:04 +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 1mxDTz-0005vd-Gc for pgsql-hackers@lists.postgresql.org; Tue, 14 Dec 2021 19:29:03 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mxDTt-0005Gq-H9 for pgsql-hackers@postgresql.org; Tue, 14 Dec 2021 19:29:02 +0000 Received: by mail-ed1-x530.google.com with SMTP id x15so67650507edv.1 for ; Tue, 14 Dec 2021 11:28:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=2l5Y21REbfvwbEOWBXCHyTxptDslbxdllchdVRtEIoc=; b=hwVxXqP40xlq+MVNpygLWtRwALuckNLbg0SbM46DWS5XHC1sG4bVUPIHtqcDoOsKc8 uG3GUMI52JGGh3j4IKnBklsCv0KC9tWNyP4gh0Vizh43NCUynM9Uxm33vrI6hyMORRhr gYNNfYOnq2qujx4+19WRLx1/r6qYc3nGFHuzRifYL1mxeSIdy4MR4Fw6m1a0/fMVnF3H XV4jduU1ogYbqlAlh1PCLmONtQtdwrH9eqXRXoPNlUZnZjXVV+1ijh7IrRqpgGw1EJSf 6xHzIRxfgrFfcRqwHYV6GaPczpmACOBBpBxDsvlBOoTKwnDwfxhr37tsT45e48RhObBl bL1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=2l5Y21REbfvwbEOWBXCHyTxptDslbxdllchdVRtEIoc=; b=mtZbXXF5+w4Mxg+aMbJK9Ktk0ac7L3UEoJhEuItPOLT1UYKj5jZ4WXuA/kY/wapDzo TJjKNfj5/aMKeTfaTcptdNoXWOxeQARoJFYckwoUziUxbXVXGmiPFWu9aPfyEWsNNp2b GyuyPYmUWykzVviu3rVKUcYAvs0OXjZKRKBmHSW8nI4cg1H0O4MDsmhvQtH5Lvlubu23 vyLqBnyx/wcGH+bTNaNCzlGX5/KIbbmR/abl4oyIl/BjgkP2omeB2Zd172+cI6LF2S/F Oy3Yk39aOm8zcSRAKSKRBMj7ObQJNHpyodMfmMk/63KyPd9ptxJ61cJQxM9MN5aLOUGV GTRA== X-Gm-Message-State: AOAM531NskxDM05flAwcMimFtXpIrO46gT/mSBdBPidZq3Ff+59lzkng 2+D3EGoTTJ6xT0UQGKyKvsUpnvz4onycCb8f5E9muAMoWupUiOb3AlfWgFdOB6HCAXt4qC1oMP7 D2DYrCa2LG7QnlH4x4cByGrgvA9LDttRnb0MZYY1IvJTPIDkxUifZolhSEp9I3FqmNzcxasyOcz qGgTYWyspLmvB3teTWe+qbpS5cw8ANW3S9tdXb X-Google-Smtp-Source: ABdhPJzspXoGgsGONhrf/cHV0aNcM4H469FUOh4HekGPBlXY5Ge0RzNNavgxQ4hywX5jDdedbburdw== X-Received: by 2002:a17:906:4bcf:: with SMTP id x15mr7621866ejv.273.1639510135271; Tue, 14 Dec 2021 11:28:55 -0800 (PST) Received: from [10.137.0.18] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id m15sm280371edl.22.2021.12.14.11.28.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Dec 2021 11:28:54 -0800 (PST) Message-ID: Date: Tue, 14 Dec 2021 20:28:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: Column Filtering in Logical Replication Content-Language: en-US To: Alvaro Herrera , Rahila Syed Cc: Amit Kapila , Peter Smith , PostgreSQL-development References: <202112141643.xerpcvfpi7bs@alvherre.pgsql> From: Tomas Vondra In-Reply-To: <202112141643.xerpcvfpi7bs@alvherre.pgsql> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/14/21 17:43, Alvaro Herrera wrote: > On 2021-Dec-13, Alvaro Herrera wrote: > >> I think this means we need a new OBJECT_PUBLICATION_REL_COLUMN value in >> the ObjectType (paralelling OBJECT_COLUMN), and no new ObjectClass >> value. Looking now to confirm. > > After working on this a little bit more, I realized that this is a bad > idea overall. It causes lots of complications and it's just not worth > it. So I'm back at my original thought that we need to throw an ERROR > at ALTER TABLE .. DROP COLUMN time if the column is part of a > replication column filter, and suggest the user to remove the column > from the filter first and reattempt the DROP COLUMN. > > This means that we need to support changing the column list of a table > in a publication. I'm looking at implementing some form of ALTER > PUBLICATION for that. > Yeah. I think it's not clear if this should behave more like an index or a view. When an indexed column gets dropped we simply drop the index. But if you drop a column referenced by a view, we fail with an error. I think we should handle this more like a view, because publications are externally visible objects too (while indexes are pretty much just an implementation detail). But why would it be easier not to add new object type? We still need to check there is no publication referencing the column - either you do that automatically through a dependency, or you do that by custom code. Using a dependency seems better to me, but I don't know what are the complications you mentioned. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company