Re: BUG #4941: pg_stat_statements crash - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4941: pg_stat_statements crash
Date
Msg-id 21301.1248661698@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #4941: pg_stat_statements crash  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: BUG #4941: pg_stat_statements crash
List pgsql-bugs
Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
> 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.

> How about executing the routine during AddinShmemInitLock is taken?

You should not hold AddinShmemInitLock any longer than really necessary.
I don't think there is a need for locking here anyway, though, since
found should be false only in the postmaster.

> The best solution might be to call shmem_startup_hook only once
> every platforms, but it is difficult without fork().

We're not changing that.  This is a bug in pgss_shmem_startup.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Itagaki Takahiro
Date:
Subject: Re: BUG #4941: pg_stat_statements crash
Next
From: Wojciech Walczak
Date:
Subject: Postgresql, ts_headline() adds space when parsing url problem