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 1pEoNZ-0007PB-VC for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Jan 2023 09:23:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pEoNY-0001ai-Rl for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Jan 2023 09:23:40 +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 1pEoNY-0001aZ-I2 for pgsql-hackers@lists.postgresql.org; Mon, 09 Jan 2023 09:23:40 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pEoNV-0007Zv-FG for pgsql-hackers@lists.postgresql.org; Mon, 09 Jan 2023 09:23:39 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id E8F51581CB0; Mon, 9 Jan 2023 04:23:34 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 09 Jan 2023 04:23:34 -0500 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=1673256214; x= 1673263414; bh=Vjv7iOhwXTbD7Gx11cbPdleL6SwUCH0T/wzDPQ3hhP8=; b=q c2MbY/xVzDhLAXi4P56GLdxnfxKPAm7800glFxJodAtj+HLdWOi7vY4VVKXM/fNf yhJWDGRqLUhFGOO3hW7gUizYGmXxGr5FrjYNnA78bNYIhjurhNI5Hl5uoeuBIwSI lg0yzw4Jg7TSD7VpVbSY5VtXPzIKbFRhMAI5wR7UcEVYIn+3mXn/BG5oG2Lfk5qM TjME2R29Pv/7loONtNSV1q1E25YlLauA5eFXHg+xvXpgxrYIxFY+jzXKIn64Th9N qcdlVDskb3aM9JhM4lJQqdV5PpRzlMq1ktIazFD+bsjSQGUDDbKGFZor8v81fezj AvEQ52dgma1knDOiv2DDg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrkeehgddufeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnth gvrhhprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeehleffgeegudejteei hfelteduvdeifffhffdvjedvffegjeekudeludehudeifeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghu thesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Jan 2023 04:23:33 -0500 (EST) Message-ID: <485382af-1dff-b3b0-9ace-67bdd0082220@enterprisedb.com> Date: Mon, 9 Jan 2023 10:23:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: Privileges on PUBLICATION Content-Language: en-US To: Antonin Houska , pgsql-hackers@lists.postgresql.org Cc: Euler Taveira , Amit Kapila References: <20330.1652105397@antos> <8a00e0e1-dc4e-422c-9dcf-664b16b18625@www.fastmail.com> <2810.1652171844@antos> <5859.1652423797@antos> <57022.1652867097@antos> <4c420c17-8570-4b52-b7f6-9ce3f53d7ef9@www.fastmail.com> <14292.1655733695@antos.home> <746c9a65-e2cc-2573-a50e-ab5ea884f680@enterprisedb.com> <1537.1667454192@antos> <2497.1667546930@antos> <043c52a4-c001-0201-94fc-305dffb8313e@enterprisedb.com> <3862.1668424068@antos> <94545.1669732512@antos> <54334.1671208627@antos> From: Peter Eisentraut In-Reply-To: <54334.1671208627@antos> 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 16.12.22 17:37, Antonin Houska wrote: > This is v4. The patch had to be rebased due to the commit 369f09e420. I think what this patch set needs first of all is a comprehensive description of what it is trying to do, exactly what commands and behaviors it adds, what are some of the subtleties and corner cases, what are open issues and questions. Some of that can be pieced together from this thread, but it should really be put in one place somewhere, ideally in the commit message and/or the documentation. (The main 0002 patch does not have any documentation.) It looks like you have a lot of bases covered, but without a full description, it's difficult to tell. Some points on the details: * You can combine all five patches into one. I don't think they are meant to be applied separately. The 0001 looks like it was maybe meant to be used separately, but it's not clear. Again, the overall description would help. * There is a lot of code that is contingent on am_db_walsender. We should avoid that. In most cases, it doesn't seem necessary. Or at least document the reasons. * The term "aware" (of a publication ACL, of a relation) is used a bunch of times. That's not a technical term, and the meaning of those phrases is not clear. Make sure the documentation/comments are precise. * I don't think using SPI is warranted here. You can get the required information directly from the underlying functions. * The places the privileges are ultimately checked is too unprincipled. The 0001 patch overrides a very low-level function, but the 0002 on the other hand checks the privileges by digging through the query structures by hand instead of letting the executor do it. We need to find ways to handle that that is more consistent with what the code is currently doing instead of adding more layers to it above and below. * The misc_sanity.out test output means you need to add a TOAST table to pg_publication.