pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Fuzzy thinking in is_publishable_class
Date: Thu, 09 May 2019 10:20:17 -0400
Message-ID: <3957.1557411617@sss.pgh.pa.us> (raw)
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>

Petr Jelinek <petr.jelinek@2ndquadrant.com> 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





view thread (10+ messages)  latest in thread

Message-ID: <3957.1557411617@sss.pgh.pa.us>
Permalink:  ../3957.1557411617@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3957.1557411617@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, petr.jelinek@2ndquadrant.com, peter.eisentraut@2ndquadrant.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Fuzzy thinking in is_publishable_class
  In-Reply-To: <3957.1557411617@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox