diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-05-13 17:05:48 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-05-13 17:05:48 -0400 |
commit | e34ee993fbc38c8538f9342c5961e5f61fd45180 (patch) | |
tree | 4918bc860cd500ec63ce34a2fe4aeb0e865b1b88 | |
parent | 9b42e713761a43e9ade3965285f077e2ba25bbb7 (diff) | |
download | postgresql-e34ee993fbc38c8538f9342c5961e5f61fd45180.tar.gz postgresql-e34ee993fbc38c8538f9342c5961e5f61fd45180.zip |
Improve commentary about hack in is_publishable_class().
The FirstNormalObjectId test here is a kluge that needs to go away,
but the only substitute we can think of is to add a column to pg_class,
which will take more work than can be handled right now. Add some
commentary in the meanwhile.
Discussion: https://postgr.es/m/15150.1557257111@sss.pgh.pa.us
-rw-r--r-- | src/backend/catalog/pg_publication.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c index be0a7e7390a..f8475c1aba2 100644 --- a/src/backend/catalog/pg_publication.c +++ b/src/backend/catalog/pg_publication.c @@ -91,12 +91,17 @@ check_publication_add_relation(Relation targetrel) * Does same checks as the above, but does not need relation to be opened * and also does not throw errors. * - * Note this also excludes all tables with relid < FirstNormalObjectId, + * XXX This also excludes all tables with relid < FirstNormalObjectId, * ie all tables created during initdb. This mainly affects the preinstalled - * information_schema. (IsCatalogRelationOid() only excludes tables with - * relid < FirstBootstrapObjectId, making that test rather redundant, but - * really we should get rid of the FirstNormalObjectId test not - * IsCatalogRelationOid.) + * information_schema. IsCatalogRelationOid() only excludes tables with + * relid < FirstBootstrapObjectId, making that test rather redundant, + * but really we should get rid of the FirstNormalObjectId test not + * IsCatalogRelationOid. We can't do so today because we don't want + * information_schema tables to be considered publishable; but this test + * is really inadequate for that, since the information_schema could be + * dropped and reloaded and then it'll be considered publishable. The best + * long-term solution may be to add a "relispublishable" bool to pg_class, + * and depend on that instead of OID checks. */ static bool is_publishable_class(Oid relid, Form_pg_class reltuple) |