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.89) (envelope-from ) id 1gW5us-0004L6-Kj for pgsql-general@arkaria.postgresql.org; Sun, 09 Dec 2018 20:43:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gW5uq-0004Wt-Gx for pgsql-general@arkaria.postgresql.org; Sun, 09 Dec 2018 20:43:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gW5up-0004Wl-F8 for pgsql-general@lists.postgresql.org; Sun, 09 Dec 2018 20:43:04 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gW5um-0004sL-UV for pgsql-general@lists.postgresql.org; Sun, 09 Dec 2018 20:43:03 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 49A2A21751; Sun, 9 Dec 2018 15:42:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 09 Dec 2018 15:42:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=1 kzBgHEByEWHh6Vk2NUrP4xdUzqtaD6xnpis4jnvu8c=; b=N2GZybfh1ytshj/+1 4+hBKLw9kJfB5FklC1Gz6t4XDeBpLrqEvtyTVNXGNhwt7AJB6Y+z1Y5OCSv/3TiT B64a/B2KsFfiuLW0gffn5P7o+7cvDgtiRelxQAJg/MO+kL2Ys57HrAkFTpRC4ntm txdErdHF1O4Mgu6K6GfyyNW2Kl/1K6OdSQGjiMxYnLpW96ff40zgFeA7c9EIsXkX k+K/8xUdNciPhy5gJ36ECOUrj2E/EyLFcfehrsPdwrqK2G4O4AoSdi7XDpnVrEee GSypIPSua0PjZKUHhh/Cu/+eJNaOEbCoXetxQ8IAx8zdtuCADZnUHv3QPLxFoOnY m8bnw== 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=fm1; bh=1kzBgHEByEWHh6Vk2NUrP4xdUzqtaD6xnpis4jnvu 8c=; b=tUqOZX81rZDT8kxYUrAr3V+wAoqVMtsPLxQ6tV7zW7xQoR9lD+itfnq3A zrMdXAJqiLBmXPb/vjI3sla0W4LpmyjG4Ie9K01+Bf/fffwnsMn4WdfYhHwGOkBD gs+hPUg/eaYzmuX0vGYDCprePSy4O+cTm4C+GO46cr1v3T415JyIZhvxVfhnyPtd 9skdd3b6n1echnfos3Gr11J3y7Zf+zBzQUltTyXng6Ch61Dqc7PugUNd9RdGTn6D oeJeTEeQv9lgzltTNxe4r6sNozRjF8L5+lDPDAoaqaLTKBI4F19a4sYSO9U2J1vO RFaMIo/Nrafyd0Gm4+3vHnkk+jzCw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudegfedgudegvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecu fedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepuffvfhfhkf fffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcu oegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucfkphepjedurd dvuddvrddufeegrdefnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 56C1F102EA; Sun, 9 Dec 2018 15:42:58 -0500 (EST) Subject: =?UTF-8?Q?Re=3a_Errors_with_schema_migration_and_logical_replicatio?= =?UTF-8?B?biDigJQgZXhwZWN0ZWQ/?= To: Mike Lissner Cc: pgsql-general@lists.postgresql.org References: <42bcb35c-9173-bb9e-bda6-ea5c5950119b@aklaver.com> <953748cf-7271-7230-9158-178c8e4f475e@aklaver.com> From: Adrian Klaver Message-ID: Date: Sun, 9 Dec 2018 12:42:57 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/9/18 10:47 AM, Mike Lissner wrote: > > My contention is that for all these reasons, there should *never* have > been a null value in that column on master. > > > > column ever had a null value and I tried to run a DDL to add a null > > constraint, the DDL would have failed, right? > > > > Something feels wrong here, the more I think about it. > > A start would be to figure out what generated?: > > failing row contains (48064261, 2018-12-07 04:48:40.388377+00, > 2018-12-07 04:48:40.388402+00, null, 576, , 4571214, null, null) > > > Yes, I completely agree. I can't think of any way that that should have > ever been created. 1) Using psql have you verified that NOT NULL is set on that column on the publisher? 2) And that the row that failed in the subscriber is in the publisher table. 3) That there are no NULL values in the publisher column? Whatever the answers to 1), 2) and 3) are the next question is: 4) Do you want/need recap_sequence_number to be NOT NULL. a) If not then you could leave things as they are. b) If so then you: 1) Have to figure out what is sending NULL values to the column. Maybe a model that has null=True set when it shouldn't be? A Form/ModelForm that is allowing None/Null? Some code that is operating outside the ORM e.g. doing a direct query using from django.db import connection. 2) Clean up the NULL values in the column in the subscriber and/or publisher. > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com