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 1mxF7d-0007Nz-5k for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Dec 2021 21:14: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 1mxF7Z-0002N1-Ug for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Dec 2021 21:14:01 +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 1mxF7Z-0002Mr-8C for pgsql-hackers@lists.postgresql.org; Tue, 14 Dec 2021 21:14:01 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mxF7R-0002Ip-Ss for pgsql-hackers@postgresql.org; Tue, 14 Dec 2021 21:13:59 +0000 Received: by mail-ed1-x52b.google.com with SMTP id v1so67941342edx.2 for ; Tue, 14 Dec 2021 13:13:53 -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=qbX/8WBrgZcjk+P354aD+lcLyW9BMOtb9/QK6cngApE=; b=bf4Nse3TK/c9i7EPY0Nhow5vXPFn98MXzCguifHJs1KCvG/NeWO2Mdx12XWav7TCfd Aoc0cN18/qoqKFZpnoWl4lzRJWWfDwwhnSBFCPwDfH8kYvluuyhF9e9Mp0ekV57FYW8e S3bS75v8lZIpBxjqGRtRPKCmoi6VgtzogopqjFltxa3+Z5voDbjRIUg4fsOvwd+NymA/ LUY/xRBjGMK9CQH9wGTeVBKoT9Ta5+B3zwy26f1RjLcY+jIaqzkQe+y7a4YrUdj6VULb i5nFuaBXQttBt4xoOIQpn8nvS1bBbw7qlvEX+PVCJO252L8JS/ECim+kwQeaCtt/kB+M 5AWw== 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=qbX/8WBrgZcjk+P354aD+lcLyW9BMOtb9/QK6cngApE=; b=HUJBb/FJDAk66axx573jRtdG/dJHDee0qHRlwiowaF0HubVmiAGQ1BSxe+b6u3cPsH BDU3sf7aOZbtwcHkAJIcIHx7KcxByavlVtFrBspDcyxoNI0vaT+H5TibJ2I9i6kg02rA hL2fqvPDxdLyUkeROGefZMt/KAyr/VWoiQjNU2WPjl3Lv6zyp7TUMB4TtE/A7UEEG0GS plf7uHppklin6De71Yju/8eUT4ZDBoPXp1m5cEErwe1kd+RCDBdLPK75h4CR2ZCElpeK 9lt9fIMxTQ/RzXEbZTIqprE1TLDIUtWcuzBvX05rRP5k9OS1XrtzEGrQoMvdcr+9j8hg gAFg== X-Gm-Message-State: AOAM533p52Kc4q0XPjgkYnt3p+500N/QPsTCDmdc6y9bXyuuGJZ5Ev6v mg+j/MVq8jmK0+YjYNPqjUSXztLJY7lFVZcL6BLZ9CWeDgrsH8tRVelxfpDGhGA3agw0nyTGgfm g+T0cT5lcyndApfWxG30Q1n6nntQBYwWZohgjSJhkFMVcPxItw/GyGTfuETzVk5PGdBRujHmXs6 ye+qrtXj5sWEDW4gFyw9n/nR0LK+YFjFLy1+Oy X-Google-Smtp-Source: ABdhPJzHLJXXDzt4B2b3u6M2at1RVUOsIL5ISDP/E/d8SojB+EkJrWPJ3lO4EFAPC0M1NJcMlO/gXg== X-Received: by 2002:a17:907:9711:: with SMTP id jg17mr8430711ejc.242.1639516432251; Tue, 14 Dec 2021 13:13:52 -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 jl8sm273660ejc.59.2021.12.14.13.13.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Dec 2021 13:13:51 -0800 (PST) Message-ID: <2c13ab4b-29af-c082-e223-7208e2f2ec79@enterprisedb.com> Date: Tue, 14 Dec 2021 22:13:49 +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 Cc: Rahila Syed , Amit Kapila , Peter Smith , PostgreSQL-development References: <202112141935.3j2lva3je7o6@alvherre.pgsql> From: Tomas Vondra In-Reply-To: <202112141935.3j2lva3je7o6@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 20:35, Alvaro Herrera wrote: > On 2021-Dec-14, Tomas Vondra wrote: > >> 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). > > I agree -- I think it's more like a view than like an index. (The > original proposal was that if you dropped a column that was part of the > column list of a relation in a publication, the entire relation is > dropped from the view, but that doesn't seem very friendly behavior -- > you break the replication stream immediately if you do that, and the > only way to fix it is to send a fresh copy of the remaining subset of > columns.) > Right, that's my reasoning too. >> 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. > > The problem is that we need a way to represent the object "column of a > table in a publication". I found myself adding a lot of additional code > to support OBJECT_PUBLICATION_REL_COLUMN and that seemed like too much. > My experience with dependencies is pretty limited, but can't we simply make a dependency between the whole publication and the column? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company