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 1hOjuL-0005A0-13 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 May 2019 14:20:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hOjuI-0004c0-IP for pgsql-hackers@arkaria.postgresql.org; Thu, 09 May 2019 14:20:22 +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 1hOjuI-0004Je-2T for pgsql-hackers@lists.postgresql.org; Thu, 09 May 2019 14:20:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hOjuF-0003I4-Qe for pgsql-hackers@lists.postgresql.org; Thu, 09 May 2019 14:20:20 +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 x49EKH4o003958; Thu, 9 May 2019 10:20:17 -0400 From: Tom Lane To: Petr Jelinek cc: Peter Eisentraut , pgsql-hackers@lists.postgresql.org Subject: Re: Fuzzy thinking in is_publishable_class In-reply-to: <5776c9b4-6ee6-cf58-7d61-0189330876c0@2ndquadrant.com> References: <15150.1557257111@sss.pgh.pa.us> <29939.1557369425@sss.pgh.pa.us> <5776c9b4-6ee6-cf58-7d61-0189330876c0@2ndquadrant.com> Comments: In-reply-to Petr Jelinek message dated "Thu, 09 May 2019 14:31:10 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3956.1557411617.1@sss.pgh.pa.us> Date: Thu, 09 May 2019 10:20:17 -0400 Message-ID: <3957.1557411617@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Petr Jelinek writes: > I think we need a better way of identifying what's part of system and > what's user created in general. The FirstNormalObjectId seems somewhat > okay approximation, but then we have plenty of other ways for checking, > maybe it's time to consolidate it into some extra column in pg_class? I'd be on board with adding "bool relpublishable" or the like to pg_class. We'd also need infrastructure for setting that, of course, so it's not a five-minute fix. In the meantime I guess we have to leave the is_publishable_class test like it is. I am thinking though that the replication code's tests of type OIDs against FirstNormalObjectId are broken. The essential property that those are after, IIUC, is "will the remote server certainly have the same definition of this type as the local one?" That is *absolutely not guaranteed* for types defined in information_schema, because their OIDs aren't locked down and could plausibly be different across installations. I forget whether we load collations before or after information_schema, so this might or might not be a live bug today, but it's certainly something waiting to bite us on the rear. Actually --- that's for logical replication, isn't it? And we allow logical replication across versions, don't we? If so, it is a live bug. Only hand-assigned type OIDs should be trusted to hold still across major versions. In short I think we'd better s/FirstNormalObjectId/FirstGenbkiObjectId/ in logical/relation.c and pgoutput/pgoutput.c, and I think that's probably a back-patchable bug fix of some urgency. regards, tom lane