Check schema ownership in worker_merge_* functions

pull/2490/head
Marco Slot 2018-11-22 17:16:57 +01:00
parent e9a7295ead
commit c4ad899dd8
1 changed files with 12 additions and 0 deletions

View File

@ -103,6 +103,12 @@ worker_merge_files_into_table(PG_FUNCTION_ARGS)
resetStringInfo(jobSchemaName);
appendStringInfoString(jobSchemaName, "public");
}
else
{
Oid schemaId = get_namespace_oid(jobSchemaName->data, false);
EnsureSchemaOwner(schemaId);
}
/* create the task table and copy files into the table */
columnNameList = ArrayObjectToCStringList(columnNameObject);
@ -172,6 +178,12 @@ worker_merge_files_and_run_query(PG_FUNCTION_ARGS)
resetStringInfo(jobSchemaName);
appendStringInfoString(jobSchemaName, "public");
}
else
{
Oid schemaId = get_namespace_oid(jobSchemaName->data, false);
EnsureSchemaOwner(schemaId);
}
appendStringInfo(setSearchPathString, SET_SEARCH_PATH_COMMAND, jobSchemaName->data);