Frank van Vugt wrote: > <TL> > > No. There are two StartTransactionCommand calls in autovacuum.c, and > > what I'm suggesting is to add the ActiveSnapshot assignment after each > > one. > > I've changed autovacuum.c per this diff, I 'hope' I misinterpreted what > needed > to be done (see below):
No, that diff is exactly what I applied. But I think you must have done something else wrong, because while I can reproduce the crash easily on the unpatched tree with your example, it certainly does not crash on CVS HEAD. Test case attached for the curious ... -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.
create table purchaseorder_line_status (id serial primary key, abbreviation text unique); create table purchaseorder_line (salesorder_line_id int, status_id int references purchaseorder_line_status(id)); CREATE OR REPLACE FUNCTION pol_stat(varchar) RETURNS int LANGUAGE 'sql' IMMUTABLE STRICT SECURITY INVOKER AS 'SELECT id FROM purchaseorder_line_status WHERE abbreviation = $1'; create index purchaseorder_line_idx01 on purchaseorder_line (salesorder_line_id) where status_id <> pol_stat('POL_CANCELLED') AND status_id <> pol_stat('POL_HANDLED'); insert into pg_autovacuum values ('purchaseorder_line'::regclass, 't', 99,99, 5, 0, -1, -1); insert into purchaseorder_line_status (abbreviation) values ('POL_HANDLED'); insert into purchaseorder_line_status (abbreviation) values ('POL_CANCELLED'); insert into purchaseorder_line_status (abbreviation) values ('POL_STARTED'); insert into purchaseorder_line_status (abbreviation) values ('POL_PAID'); insert into purchaseorder_line_status (abbreviation) values ('POL_MADE_UP'); insert into purchaseorder_line values (1, 1); insert into purchaseorder_line values (2, 2); insert into purchaseorder_line values (3, 3); insert into purchaseorder_line values (4, 4); insert into purchaseorder_line values (5, 5); insert into purchaseorder_line values (6, 1); insert into purchaseorder_line values (7, 2); insert into purchaseorder_line values (8, 3); insert into purchaseorder_line values (9, 4); insert into purchaseorder_line values (10, 5);
---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings