Re: BUG #5669: server process was terminated by exception 0xC0000005

Поиск
Список
Период
Сортировка
От Andrew Geery
Тема Re: BUG #5669: server process was terminated by exception 0xC0000005
Дата
Msg-id AANLkTimtyn=8aR8ES2KZUPD7LZHQQq9coCm6KNof_yxS@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #5669: server process was terminated by exception 0xC0000005  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: BUG #5669: server process was terminated by exception 0xC0000005  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
I think I've tracked down the problem, although I haven't been able to
get a stack trace yet.  I'm afraid that it's my own stupidity, but I
still don't understand why this crashes the entire engine.

On the collection table, I have a FTS index.  I probably should have
defined the index this way:

create index ix_collection_name_fts on collection using
gin(to_tsvector('english', name));

but instead I defined it this way:

create index ix_collection_name_fts on collection using
gin(to_tsvector(get_fts_config_name(), name));

where the definition of the function is:

create or replace function get_fts_config_name() returns regconfig as $$
            select setting::regconfig from pg_settings
                where name =3D 'default_text_search_config';
        $$ language sql immutable;

Once I remove the bad FTS index and replaced it with the good index,
the server no longer crashes.

Reading about immutable functions here
[http://developer.postgresql.org/pgdocs/postgres/xfunc-volatility.html],
made it sound like the only problem with making a volatile function
immutable is that the query planner might do the wrong thing.  I
didn't realize it could have such drastic results...  Is it still
worth getting a stack trace or is this just a don't-ever-do-that
thing?

Thanks
Andrew

On Tue, Sep 21, 2010 at 5:50 PM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> Excerpts from Andrew Geery's message of mar sep 21 16:37:20 -0400 2010:
>> Running the server in debug mode, I see the following before the
>> server crashes -- it looks like something goes wrong with
>> autovac_balance_cost when trying to analyze the collection table (that
>> was the table the inserts were being done into).
>>
>> Thanks
>
> Hmm, can you get a stack trace? =A0Please see
> http://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_Postgr=
eSQL_backend_on_Windows
>
> Probably the easiest way to catch a dying autovacuum process is to set a
> very high value of vacuum_cost_delay, so that it sleeps for long enough
> that you can attach to it with the debugger before it dies.
>
> Thanks
>
> --
> =C1lvaro Herrera <alvherre@commandprompt.com>
> The PostgreSQL Company - Command Prompt, Inc.
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
>

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5662: Incomplete view
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5669: server process was terminated by exception 0xC0000005