@@ -243,9 +243,14 @@ interpretInhOption(InhOption inhOpt)
243243 * table/result set should be created with OIDs. This needs to be done after
244244 * parsing the query string because the return value can depend upon the
245245 * default_with_oids GUC var.
246+ *
247+ * Materialized views are handled here rather than reloptions.c because that
248+ * code explicitly punts checking for oids to here. We prohibit any explicit
249+ * specification of the oids option for a materialized view, and indicate that
250+ * oids are not needed if we don't get an error.
246251 */
247252bool
248- interpretOidsOption (List * defList )
253+ interpretOidsOption (List * defList , char relkind )
249254{
250255ListCell * cell ;
251256
@@ -256,9 +261,19 @@ interpretOidsOption(List *defList)
256261
257262if (def -> defnamespace == NULL &&
258263pg_strcasecmp (def -> defname ,"oids" )== 0 )
264+ {
265+ if (relkind == RELKIND_MATVIEW )
266+ ereport (ERROR ,
267+ (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
268+ errmsg ("unrecognized parameter \"%s\"" ,"oids" )));
269+
259270return defGetBoolean (def );
271+ }
260272}
261273
274+ if (relkind == RELKIND_MATVIEW )
275+ return false;
276+
262277/* OIDS option was not specified, so use default. */
263278return default_with_oids ;
264279}