fixup! Introduces getObjectTypeDescription_compat and getObjectIdentity_compat macros

talha_testpg14
Sait Talha Nisanci 2021-08-26 23:49:11 +03:00
parent db87eab790
commit dfcc7932a0
3 changed files with 9 additions and 6 deletions

View File

@ -251,7 +251,7 @@ GetDependencyCreateDDLCommands(const ObjectAddress *dependency)
*/ */
Assert(false); Assert(false);
ereport(ERROR, (errmsg("unsupported object %s for distribution by citus", ereport(ERROR, (errmsg("unsupported object %s for distribution by citus",
getObjectTypeDescription_compat(dependency, false)), getObjectTypeDescription_compat(dependency, /* missingOk: */ false)),
errdetail( errdetail(
"citus tries to recreate an unsupported object on its workers"), "citus tries to recreate an unsupported object on its workers"),
errhint("please report a bug as this should not be happening"))); errhint("please report a bug as this should not be happening")));

View File

@ -1613,7 +1613,8 @@ PreprocessAlterFunctionDependsStmt(Node *node, const char *queryString,
* workers * workers
*/ */
const char *functionName = getObjectIdentity_compat(&address, false); const char *functionName =
getObjectIdentity_compat(&address, /* missingOk: */ false);
ereport(ERROR, (errmsg("distrtibuted functions are not allowed to depend on an " ereport(ERROR, (errmsg("distrtibuted functions are not allowed to depend on an "
"extension"), "extension"),
errdetail("Function \"%s\" is already distributed. Functions from " errdetail("Function \"%s\" is already distributed. Functions from "
@ -1932,8 +1933,10 @@ ErrorIfFunctionDependsOnExtension(const ObjectAddress *functionAddress)
if (IsObjectAddressOwnedByExtension(functionAddress, &extensionAddress)) if (IsObjectAddressOwnedByExtension(functionAddress, &extensionAddress))
{ {
char *functionName = getObjectIdentity_compat(functionAddress, false); char *functionName =
char *extensionName = getObjectIdentity_compat(&extensionAddress, false); getObjectIdentity_compat(functionAddress, /* missingOk: */ false);
char *extensionName =
getObjectIdentity_compat(&extensionAddress, /* missingOk: */ false);
ereport(ERROR, (errmsg("unable to create a distributed function from functions " ereport(ERROR, (errmsg("unable to create a distributed function from functions "
"owned by an extension"), "owned by an extension"),
errdetail("Function \"%s\" has a dependency on extension \"%s\". " errdetail("Function \"%s\" has a dependency on extension \"%s\". "

View File

@ -75,8 +75,8 @@ citus_unmark_object_distributed(PG_FUNCTION_ARGS)
{ {
ereport(ERROR, (errmsg("object still exists"), ereport(ERROR, (errmsg("object still exists"),
errdetail("the %s \"%s\" still exists", errdetail("the %s \"%s\" still exists",
getObjectTypeDescription_compat(&address, false), getObjectTypeDescription_compat(&address, /* missingOk: */ false),
getObjectIdentity_compat(&address, false)), getObjectIdentity_compat(&address, /* missingOk: */ false)),
errhint("drop the object via a DROP command"))); errhint("drop the object via a DROP command")));
} }