@@ -243,9 +243,14 @@ interpretInhOption(InhOption inhOpt)
243
243
* table/result set should be created with OIDs. This needs to be done after
244
244
* parsing the query string because the return value can depend upon the
245
245
* 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.
246
251
*/
247
252
bool
248
- interpretOidsOption (List * defList )
253
+ interpretOidsOption (List * defList , char relkind )
249
254
{
250
255
ListCell * cell ;
251
256
@@ -256,9 +261,19 @@ interpretOidsOption(List *defList)
256
261
257
262
if (def -> defnamespace == NULL &&
258
263
pg_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
+
259
270
return defGetBoolean (def );
271
+ }
260
272
}
261
273
274
+ if (relkind == RELKIND_MATVIEW )
275
+ return false;
276
+
262
277
/* OIDS option was not specified, so use default. */
263
278
return default_with_oids ;
264
279
}