mirror of https://github.com/citusdata/citus.git
Use correct errorCode for the errors thrown during recovery (#7146)
parent
afab879de3
commit
d5d1684c45
|
@ -425,7 +425,8 @@ EnsureCopyCanRunOnRelation(Oid relationId)
|
|||
*/
|
||||
if (RecoveryInProgress() && WritableStandbyCoordinator)
|
||||
{
|
||||
ereport(ERROR, (errmsg("COPY command to Citus tables is not allowed in "
|
||||
ereport(ERROR, (errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
|
||||
errmsg("COPY command to Citus tables is not allowed in "
|
||||
"read-only mode"),
|
||||
errhint("All COPY commands to citus tables happen via 2PC, "
|
||||
"and 2PC requires the database to be in a writable state."),
|
||||
|
|
|
@ -354,7 +354,8 @@ EnsureModificationsCanRun(void)
|
|||
{
|
||||
if (RecoveryInProgress() && !WritableStandbyCoordinator)
|
||||
{
|
||||
ereport(ERROR, (errmsg("writing to worker nodes is not currently allowed"),
|
||||
ereport(ERROR, (errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
|
||||
errmsg("writing to worker nodes is not currently allowed"),
|
||||
errdetail("the database is read-only")));
|
||||
}
|
||||
|
||||
|
@ -415,7 +416,8 @@ EnsureModificationsCanRunOnRelation(Oid relationId)
|
|||
|
||||
if (modifiedTableReplicated)
|
||||
{
|
||||
ereport(ERROR, (errmsg("writing to worker nodes is not currently "
|
||||
ereport(ERROR, (errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
|
||||
errmsg("writing to worker nodes is not currently "
|
||||
"allowed for replicated tables such as reference "
|
||||
"tables or hash distributed tables with replication "
|
||||
"factor greater than 1."),
|
||||
|
|
Loading…
Reference in New Issue