【操作系统和硬件信息】
【测试环境】(单机/1主x备x级联备):
一主一备
【被测功能】:导出单表数据
【数据库版本】(查询命令: gaussdb -V):
gaussdb (openGauss 3.0.3 build 46134f73) compiled at 2023-01-10 22:42:07 commit 0 last mr
【预置条件】:
导出表时存在业务数据insert、update
【操作步骤】(请填写详细的操作步骤):
Hey @wangpy_1092, Welcome to openGauss Community.
All of the projects in openGauss Community are maintained by @opengauss-bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at Here to find the details.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
Hi @wangpy_1092, please use the command /sig xxx to add a SIG label to this issue.
For example: /sig sqlengine or /sig storageengine or /sig om or /sig ai and so on.
You can find more SIG labels from Here.
If you have no idea about that, please contact with @xiangxinyong , @zhangxubo .
您好,目前问题相关报错,猜测是上一条语句执行失败,导致事务失败导致的问题。
从目前提供的日志信息来看,无法确认具体问题。
可以请您提供对应pg_log或者提供下必先步骤吗?
char* recycleObject = NULL;
char* f = "f";
/* Make sure we are in proper schema */
selectSourceSchema(fout, "pg_catalog");
appendPQExpBuffer(query,
"SELECT pg_catalog.gs_is_recycle_obj(%u, %u, NULL)",
classid,
objid);
res = ExecuteSqlQuery(fout, query->data, PGRES_TUPLES_OK);
colNum = PQfnumber(res, "gs_is_recycle_obj");
recycleObject = gs_strdup(PQgetvalue(res, tupNum, colNum));
if (strcmp(recycleObject, f) == 0) {
isRecycleObj = false;
} else {
isRecycleObj = true;
}
static void selectSourceSchema(Archive* fout, const char* schemaName)
{
static char* curSchemaName = NULL;
PQExpBuffer query;
/* Not relevant if fetching from pre-7.3 DB */
if (fout->remoteVersion < 70300)
return;
/* Ignore null schema names */
if (schemaName == NULL || *schemaName == '\0')
return;
/* Optimize away repeated selection of same schema */
if ((curSchemaName != NULL) && strcmp(curSchemaName, schemaName) == 0)
return;
query = createPQExpBuffer();
/*
* It is invalid to set pg_temp or pg_catalog behind other schemas in search path explicitly.
* The priority order is pg_temp, pg_catalog and other schemas.
*/
appendPQExpBuffer(query, "SET search_path = %s", fmtId(schemaName));
ExecuteSqlStatement(fout, query->data);
destroyPQExpBuffer(query);
if (curSchemaName != NULL) {
free(curSchemaName);
curSchemaName = NULL;
}
curSchemaName = gs_strdup(schemaName);
}
void ExecuteSqlStatement(Archive* AHX, const char* query)
{
ArchiveHandle* AH = (ArchiveHandle*)AHX;
PGresult* res = NULL;
res = PQexec(AH->connection, query);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
die_on_query_failure(AH, modulename, query);
PQclear(res);
}
登录 后才可以发表评论