From: Tom Lane Date: Mon, 27 Jul 2009 03:34:40 +0000 (+0000) Subject: Fix pg_stat_statements for EXEC_BACKEND case. X-Git-Tag: REL8_5_ALPHA1~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4b9e65393d031b55a164765f8505af01e1ca178;p=postgresql Fix pg_stat_statements for EXEC_BACKEND case. We should not try to load old statistics when re-attaching to existing shared memory. Per bug #4941. Itagaki Takahiro --- diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c index 5a818ba042..11d0721861 100644 --- a/contrib/pg_stat_statements/pg_stat_statements.c +++ b/contrib/pg_stat_statements/pg_stat_statements.c @@ -14,7 +14,7 @@ * Copyright (c) 2008-2009, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/contrib/pg_stat_statements/pg_stat_statements.c,v 1.3 2009/06/11 14:48:51 momjian Exp $ + * $PostgreSQL: pgsql/contrib/pg_stat_statements/pg_stat_statements.c,v 1.4 2009/07/27 03:34:40 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -332,7 +332,7 @@ pgss_shmem_startup(void) * 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);