From: Tom Lane Date: Thu, 10 Nov 2016 20:00:58 +0000 (-0500) Subject: Re-allow user_catalog_table option for materialized views. X-Git-Tag: REL9_6_2~137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05a6e872898acad6a66f9fd0be01e30ae1fb0f75;p=postgresql Re-allow user_catalog_table option for materialized views. The reloptions stuff allows this option to be set on a matview. While it's questionable whether that is useful or was really intended, it does work, and we shouldn't change that in minor releases. Commit e3e66d8a9 disabled the option since I didn't realize that it was possible for it to be set on a matview. Tweak the test to re-allow it. Discussion: <19749.1478711862@sss.pgh.pa.us> --- diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index c867ebb233..fa15f28468 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -270,8 +270,9 @@ typedef struct StdRdOptions * from the pov of logical decoding. Note multiple eval of argument! */ #define RelationIsUsedAsCatalogTable(relation) \ - ((relation)->rd_rel->relkind == RELKIND_RELATION && \ - (relation)->rd_options ? \ + ((relation)->rd_options && \ + ((relation)->rd_rel->relkind == RELKIND_RELATION || \ + (relation)->rd_rel->relkind == RELKIND_MATVIEW) ? \ ((StdRdOptions *) (relation)->rd_options)->user_catalog_table : false) /*