Re: [BUGS] BUG #4941: pg_stat_statements crash - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: [BUGS] BUG #4941: pg_stat_statements crash
Date
Msg-id 20090727114035.E3D2.52131E4D@oss.ntt.co.jp
Whole thread Raw
Responses Re: [BUGS] BUG #4941: pg_stat_statements crash  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: [BUGS] BUG #4941: pg_stat_statements crash  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> > We should call [Read dumpfile] routine only once even on Windows.
> Seems to me that you should simply do the load only when found is false.

Here is a patch to fix pg_stat_statements on Windows.

I see we don't need any locks because initialization is done in postmaster;
There are no chance to see uninitialized state of 'pgss' after relasing
AddinShmemInitLock and before load dumpfile into it.

I also check pgss_shmem_shutdown and no problem.
It is called only once from postmaster on shutdown.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: generic explain options v3
Next
From: Robert Haas
Date:
Subject: Re: autogenerating headers & bki stuff