mirror of https://github.com/citusdata/citus.git
Give WARNING if object is local, ERROR out if it is distributed
parent
81ea6c308c
commit
50201f4bec
|
@ -93,6 +93,11 @@ PostprocessViewStmt(Node *node, const char *queryString)
|
|||
return NIL;
|
||||
}
|
||||
|
||||
if (!HasAnyNodes())
|
||||
{
|
||||
return NIL;
|
||||
}
|
||||
|
||||
ObjectAddress viewAddress = GetObjectAddressFromParseTree((Node *) stmt, false);
|
||||
|
||||
if (IsObjectAddressOwnedByExtension(&viewAddress, NULL))
|
||||
|
@ -105,13 +110,16 @@ PostprocessViewStmt(Node *node, const char *queryString)
|
|||
|
||||
if (errMsg != NULL)
|
||||
{
|
||||
if (HasAnyNodes())
|
||||
if (IsObjectDistributed(&viewAddress))
|
||||
{
|
||||
RaiseDeferredError(errMsg, ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
RaiseDeferredError(errMsg, WARNING);
|
||||
}
|
||||
|
||||
return NIL;
|
||||
}
|
||||
}
|
||||
|
||||
EnsureDependenciesExistOnAllNodes(&viewAddress);
|
||||
|
||||
|
|
|
@ -803,8 +803,11 @@ DeferErrorIfHasUnsupportedDependency(const ObjectAddress *objectAddress)
|
|||
* Otherwise, callers are expected to throw the error returned from this
|
||||
* function as a hard one by ignoring the detail part.
|
||||
*/
|
||||
if (!IsObjectDistributed(objectAddress))
|
||||
{
|
||||
appendStringInfo(detailInfo, "\"%s\" will be created only locally",
|
||||
objectDescription);
|
||||
}
|
||||
|
||||
if (SupportedDependencyByCitus(undistributableDependency))
|
||||
{
|
||||
|
@ -815,9 +818,18 @@ DeferErrorIfHasUnsupportedDependency(const ObjectAddress *objectAddress)
|
|||
objectDescription,
|
||||
dependencyDescription);
|
||||
|
||||
if (IsObjectDistributed(objectAddress))
|
||||
{
|
||||
appendStringInfo(hintInfo, "Distribute \"%s\" first to update \"%s\" on worker nodes",
|
||||
dependencyDescription,
|
||||
objectDescription);
|
||||
}
|
||||
else
|
||||
{
|
||||
appendStringInfo(hintInfo, "Distribute \"%s\" first to distribute \"%s\"",
|
||||
dependencyDescription,
|
||||
objectDescription);
|
||||
}
|
||||
|
||||
return DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED,
|
||||
errorInfo->data, detailInfo->data, hintInfo->data);
|
||||
|
|
Loading…
Reference in New Issue