Index: contrib/pg_stat_statements/pg_stat_statements.c =================================================================== --- contrib/pg_stat_statements/pg_stat_statements.c (HEAD) +++ contrib/pg_stat_statements/pg_stat_statements.c (working copy) @@ -332,7 +332,7 @@ * Note: we don't bother with locks here, because there should be no other * processes running when this is called. */ - if (!pgss_save) + if (found || !pgss_save) return; file = AllocateFile(PGSS_DUMP_FILE, PG_BINARY_R);