Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dws2Y-0006uw-DL for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Sep 2017 15:44:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dws2X-0003lu-Uv for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Sep 2017 15:44:53 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dws1p-0002Wu-5v for pgsql-bugs@postgresql.org; Tue, 26 Sep 2017 15:44:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dws1k-0008Ha-5N for pgsql-bugs@postgresql.org; Tue, 26 Sep 2017 15:44:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v8QFhse1011185; Tue, 26 Sep 2017 11:43:54 -0400 From: Tom Lane To: Peter Eisentraut cc: Andres Freund , yxq@o2.pl, pgsql-bugs@postgresql.org Subject: Re: BUG #14785: Logical replication does not work after adding a column. Bug? In-reply-to: <073783f4-ccf0-65d8-ffa2-01d339958978@2ndquadrant.com> References: <20170820191720.1454.19868@wrigleys.postgresql.org> <14aeb673-fded-e9dd-9e90-f04908f9eadf@2ndquadrant.com> <20170822193418.drjntpluvcidfqyf@alap3.anarazel.de> <4dfb4e26-9542-85d6-ff61-9e7080796b0e@2ndquadrant.com> <20170823163151.5dankkw7z72ltmvw@alap3.anarazel.de> <020d1ec1-70d6-a4e9-f7f6-ab7eed8f5985@2ndquadrant.com> <20170823213949.g7wpurzt6hbi3e5h@alap3.anarazel.de> <20170925191655.xcn3tsnuibep3jro@alap3.anarazel.de> <073783f4-ccf0-65d8-ffa2-01d339958978@2ndquadrant.com> Comments: In-reply-to Peter Eisentraut message dated "Tue, 26 Sep 2017 10:31:00 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11183.1506440634.1@sss.pgh.pa.us> Date: Tue, 26 Sep 2017 11:43:54 -0400 Message-ID: <11184.1506440634@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Peter Eisentraut writes: > On 9/25/17 15:16, Andres Freund wrote: >> This'll accept tablenames like pg_temp_1foo, right? Might be worth >> being a bit narrower in the test. > Committed with that change. Thanks. This patch is using the wrong approach entirely. Every other place in the backend that is trying to exclude temp relations uses a test on the containing namespace, not the relname. You should be using RELATION_IS_OTHER_TEMP(), or if there's good reason to decide this without opening the relation, maybe you could get away with isOtherTempNamespace(get_rel_namespace(relid)). I also note that as committed, the patch will dump core on a concurrently-dropped relation, because get_rel_name returns NULL under such circumstances. BTW, get_rel_sync_entry has some other serious problems: it is not being at all careful about whether persistent data structures are left in sane states if it gets an error partway through. In particular it'll leave behind a new hash entry in entirely-unknown state, and if LoadPublications gets an error, it will also leave a time bomb behind in the form of not nil, but already-list-freed, data->publications. And I sure do not understand why a single static variable publications_valid is being used to remember validity of data->publications ... couldn't there be more than one of those? regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs