Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jH5Ah-0002yl-GT for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2020 12:30:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jH5Ag-0006tT-9s for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2020 12:30:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jH5Ae-0006ot-Vy for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2020 12:30:10 +0000 Received: from [66.111.4.27] (helo=out3-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jH5Ac-000702-6U for pgsql-hackers@postgresql.org; Wed, 25 Mar 2020 12:30:07 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 73A2A5C0228; Wed, 25 Mar 2020 08:29:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 25 Mar 2020 08:29:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=l7BmOzAWQfmDgDXbXhUlni7m+wGzcL03VMkhBZU5V mc=; b=HBvxIEUSghjVhuBNJs5wbXRs0UJhZw8Qjjhb3PQjhaiJnRly5rlXILlb0 vNy/+U3Uy9Ca9VT8ABz0y9CKypZ//y8ZxVEQwBfMCJhLchgXUNfzqsImM8tbikY4 8pN3QimiwP+p+I8ZgLstsx6QrESsl3HgUhI7mSkfC/OOIq3iALg+zksTj/WuKvpD DJD7v6UwrAuPqDklWpN/ZD3ezoOjDNINadwMzQs4bmyQiOnW5HBsGTMzP1ppYz2v VWm0c+S7whijq20cx0eIvNJuIaRn2qSiihUwqBCOiq1zwqHfGixsZ4hS8djqaC3P 8BEChP7OgwOvonT+85VJ6LVKX/yHQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudehgedgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhohfkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnug hquhgrughrrghnthdrtghomheqnecuffhomhgrihhnpedvnhguqhhurggurhgrnhhtrdgt ohhmnecukfhppeelfedrvdegvddrvddufedrvdegudenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vdhnughquhgrughrrghnthdrtghomh X-ME-Proxy: Received: from april.pezone.net (p5df2d5f1.dip0.t-ipconnect.de [93.242.213.241]) by mail.messagingengine.com (Postfix) with ESMTPA id 76FAA3280060; Wed, 25 Mar 2020 08:29:54 -0400 (EDT) Subject: Re: adding partitioned tables to publications To: Amit Langote References: <825b31ea-ad9f-21d1-29b6-2a494513458d@2ndquadrant.com> <73a1877a-6f1d-9f2e-da51-bc2eb57e07d5@2ndquadrant.com> Cc: Rafia Sabih , PostgreSQL-development From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Wed, 25 Mar 2020 13:29:52 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.27 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-03-23 06:02, Amit Langote wrote: > Okay, added some tests. > > Attached updated patches. I have committed the worker.c refactoring patch. "Add subscription support to replicate into partitioned tables" still has lacking test coverage. Your changes in relation.c are not exercised at all because the partitioned table branch in apply_handle_update() is never taken. This is critical and tricky code, so I would look for significant testing. The code looks okay to me. I would remove this code + memset(entry->attrmap->attnums, -1, + entry->attrmap->maplen * sizeof(AttrNumber)); because the entries are explicitly filled right after anyway, and filling the bytes with -1 has an unclear effect. There is also seemingly some fishiness in this code around whether attribute numbers are zero- or one-based. Perhaps this could be documented briefly. Maybe I'm misunderstanding something. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services