Commit 5c1b0045 authored by Philip Warner's avatar Philip Warner

Fixed but in _enableTriggersIfNecessary introduced by previous patches by me

which caused segfault in a data-only retore with BLOBs
parent fd5bac6d
......@@ -471,10 +471,17 @@ static void _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te, RestoreO
* command when one is available.
*/
ahprintf(AH, "-- Enable triggers\n");
if (te && te->name && strlen(te->name) > 0)
{
ahprintf(AH, "UPDATE pg_class SET reltriggers = "
"(SELECT count(*) FROM pg_trigger where pg_class.oid = tgrelid) "
"WHERE relname = '%s';\n\n",
te->name);
} else {
ahprintf(AH, "UPDATE \"pg_class\" SET \"reltriggers\" = "
"(SELECT count(*) FROM pg_trigger where pg_class.oid = tgrelid) "
"WHERE \"relname\" !~ '^pg_';\n\n");
}
/*
* Restore the user connection from the start of this procedure
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment