Skip to content

Commit c12c53e

Browse files
committed
Log actual PG error message during DDL WAL replay failures
1 parent 7214468 commit c12c53e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cpp/deeplake_pg/table_storage.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,15 @@ void table_storage::load_table_metadata()
335335
{
336336
set_catalog_only_create(false);
337337
MemoryContextSwitchTo(saved_context);
338+
ErrorData* edata = CopyErrorData();
338339
CurrentResourceOwner = saved_owner;
339340
RollbackAndReleaseCurrentSubTransaction();
340341
FlushErrorState();
341-
elog(WARNING, "pg_deeplake: DDL WAL replay failed (seq=%ld, tag=%s): %.200s",
342-
entry.seq, entry.command_tag.c_str(), entry.ddl_sql.c_str());
342+
elog(WARNING, "pg_deeplake: DDL WAL replay failed (seq=%ld, tag=%s): %s (SQL: %.200s)",
343+
entry.seq, entry.command_tag.c_str(),
344+
edata->message ? edata->message : "unknown error",
345+
entry.ddl_sql.c_str());
346+
FreeErrorData(edata);
343347
}
344348
PG_END_TRY();
345349
}

0 commit comments

Comments
 (0)