* Returns whether the relation is security view, or not. Note multiple
* eval of argument!
*/
-#define RelationIsSecurityView(relation) \
- ((relation)->rd_options ? \
- ((ViewOptions *) (relation)->rd_options)->security_barrier : false)
+#define RelationIsSecurityView(relation) \
+ (AssertMacro(relation->rd_rel->relkind == RELKIND_VIEW), \
+ (relation)->rd_options ? \
+ ((ViewOptions *) (relation)->rd_options)->security_barrier : false)
/*
* RelationHasCheckOption
* or the cascaded check option. Note multiple eval of argument!
*/
#define RelationHasCheckOption(relation) \
- ((relation)->rd_options && \
+ (AssertMacro(relation->rd_rel->relkind == RELKIND_VIEW), \
+ (relation)->rd_options && \
((ViewOptions *) (relation)->rd_options)->check_option != \
VIEW_OPTION_CHECK_OPTION_NOT_SET)
* option. Note multiple eval of argument!
*/
#define RelationHasLocalCheckOption(relation) \
- ((relation)->rd_options && \
+ (AssertMacro(relation->rd_rel->relkind == RELKIND_VIEW), \
+ (relation)->rd_options && \
((ViewOptions *) (relation)->rd_options)->check_option == \
VIEW_OPTION_CHECK_OPTION_LOCAL)
* option. Note multiple eval of argument!
*/
#define RelationHasCascadedCheckOption(relation) \
- ((relation)->rd_options && \
+ (AssertMacro(relation->rd_rel->relkind == RELKIND_VIEW), \
+ (relation)->rd_options && \
((ViewOptions *) (relation)->rd_options)->check_option == \
VIEW_OPTION_CHECK_OPTION_CASCADED)