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 1nlTDB-0001LR-Ud for pgsql-hackers@arkaria.postgresql.org; Mon, 02 May 2022 10:23:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nlTDA-0000SL-MJ for pgsql-hackers@arkaria.postgresql.org; Mon, 02 May 2022 10:23:24 +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 1nlTDA-0000SA-D0 for pgsql-hackers@lists.postgresql.org; Mon, 02 May 2022 10:23:24 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nlTD7-0005cj-7L for pgsql-hackers@lists.postgresql.org; Mon, 02 May 2022 10:23:23 +0000 Received: by mail-ej1-x633.google.com with SMTP id kq17so26919274ejb.4 for ; Mon, 02 May 2022 03:23:20 -0700 (PDT) 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=QnNi3wTuAFoo2R9Ij4/C5G2dORx+HmWIPIGe5rA62nA=; b=ZfTSRI6TKEjUVSTwQZO/EnmGc/pa96BUOVnqVrZX12cmzw61rm848xpIe6t1UjigDp JkYgBPSLxsJQlLj7D6ksRpX4tcymbZ26ydB1ugPL0YhTo4m105NG26f3EOCFC9kJwiBo C/MVKNEeSgHz39u7gf2eJ8rQrBLDhtqpG5Hv7j8q9u9gKifphZSvS2saCCUi/Zi473tV WRaetCOxZeM8Cqvto+T7gHOAaH4LkTpxB6BKHid+j61GqQsfUyweql6593nhkqoYcm0q XX8yxnYJ3cDvjdJVmXT0Ls+ODRWeoDdvri3YoW7Y4HeQFoc9i5ZhbUp2Ii6cD5L1piyI RnQA== 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=QnNi3wTuAFoo2R9Ij4/C5G2dORx+HmWIPIGe5rA62nA=; b=6Hh0LFWH1b0jzh09uhgatByzZFiar83lOfUEgJUwwBaw0EBk3Vv6TVZ/pV+sWeM8Ly 1fpNFbS4Vgkuc/hrzrxEr/xTrkh26FR8DiVni5xiPDUzanTh8oDzaxpy9LK7fKA61vdG OipvoZTTuVeMzwikbyUaTHwXeIPB/QSG1oRB9rEdFShrHsm8f5HPVyWth0cAxh0X4SBh 3mHXI0zpJOlAOyCgGLsYeHaonMJOdP5iv5CNdIALiZv+psmzZOcqW7Decqov65iAatbs 858I9uL7yAU0Nxb5uvWl5y/mr7DYgWBvan8Z4QWs9B+ZzQrW4zQqzNyBY/PW/EDoVfvL Qhyw== X-Gm-Message-State: AOAM533FY96caame3Rf2kVGucR7BYuC5boLHWSIQLnU/Fn9+ZDxYuEyx GQhlM9mW+2URTb8A483uFZz6MYHvou37SHDMLpoNw4ETggVL8AQCQD0kBEzwDkYUNwDlUq22YFp PxgHGAyFJYS16D/O8BwEXl4Lg5C0JFa7sCg8HvZSIO8LDBO3oRreS77PZTomn92b+deysG8C6Al i/7jZh08XuMMWLRK0wMimMHpX+J18Ke7g054dvrf5BTxv51L0qOc+l X-Google-Smtp-Source: ABdhPJy3o0PElOhR2xIjMzcmZnQIKo+qfFu45S+0FQKalJ5CY0dkiZSSyI+Nr8hkWLu9C5KkCmnwLw== X-Received: by 2002:a17:907:7618:b0:6f3:9722:3dd1 with SMTP id jx24-20020a170907761800b006f397223dd1mr5456027ejc.424.1651486998385; Mon, 02 May 2022 03:23:18 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-250-165.net.upcbroadband.cz. [86.49.250.165]) by smtp.gmail.com with ESMTPSA id hg1-20020a1709072cc100b006f3ef214e72sm3431293ejc.216.2022.05.02.03.23.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 May 2022 03:23:17 -0700 (PDT) Message-ID: <37755ade-9fae-fec0-6602-e5b496c2a95c@enterprisedb.com> Date: Mon, 2 May 2022 12:23:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: bogus: logical replication rows/cols combinations Content-Language: en-US To: Alvaro Herrera Cc: Amit Kapila , Peter Eisentraut , Pg Hackers References: <202205021017.himfy7asanau@alvherre.pgsql> From: Tomas Vondra In-Reply-To: <202205021017.himfy7asanau@alvherre.pgsql> Content-Type: text/plain; charset=UTF-8 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 5/2/22 12:17, Alvaro Herrera wrote: > On 2022-May-02, Tomas Vondra wrote: >> On 5/2/22 07:31, Amit Kapila wrote: > >>> Yeah, or don't allow to define such publications in the first place so >>> that different subscriptions can't combine them but I guess that might >>> forbid some useful cases as well where publication may not get >>> combined with other publications. >> >> But how would you check that? You don't know which publications will be >> combined by a subscription until you create the subscription, right? > > ... and I think this poses a problem: if the publisher has multiple > publications and the subscriber later uses those to create a combined > subscription, we can check at CREATE SUBSCRIPTION time that they can be > combined correctly. But if the publisher decides to change the > publications changing the rules and they are no longer consistent, can > we throw an error at ALTER PUBLICATION point? If the publisher can > detect that they are being used together by some subscription, then > maybe we can check consistency in the publication side and everything is > all right. But I'm not sure that the publisher knows who is subscribed > to what, so this might not be an option. > AFAIK we don't track that (publication/subscription mapping). The publications are listed in publication_names parameter of the START_REPLICATION command. > The latter ultimately means that we aren't sure that a combined > subscription is safe. And in turn this means that a pg_dump of such a > database cannot be restored (because the CREATE SUBSCRIPTION will be > rejected as being inconsistent). > We could do this check when executing the START_REPLICATION command, no? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company