Add warnings to user-callable functions

This commit is contained in:
Adam Guo 2025-03-04 22:13:46 +00:00
parent 6d1646db7a
commit 7f71f7c5e7

View file

@ -191,6 +191,8 @@ create_immv(PG_FUNCTION_ARGS)
CreateTableAsStmt *ctas;
StringInfoData command_buf;
warnIfPgIvmNotPreloaded();
parseNameAndColumns(relname, &names, &colNames);
initStringInfo(&command_buf);
@ -250,6 +252,8 @@ refresh_immv(PG_FUNCTION_ARGS)
QueryCompletion qc;
StringInfoData command_buf;
warnIfPgIvmNotPreloaded();
initStringInfo(&command_buf);
appendStringInfo(&command_buf, "SELECT refresh_immv('%s, %s);",
relname, ispopulated ? "true" : "false");
@ -364,6 +368,8 @@ get_immv_def(PG_FUNCTION_ARGS)
Query *query = NULL;
char *querystring = NULL;
warnIfPgIvmNotPreloaded();
/* Make sure IMMV is a table. */
if (get_rel_relkind(matviewOid) != RELKIND_RELATION)
PG_RETURN_NULL();