Christopher B. Browne's Home Page
cbbrowne@acm.org

8.124. tablestovacuum()

Function Properties

PLPGSQLSET OF vactables
Return a list of tables that require frequent vacuuming. The function is used so that the list is not hardcoded into C code.
    declare
    	prec vactables%rowtype;
    begin
    	prec.nspname := '_schemadoc';
    	prec.relname := 'sl_event';
    	if ShouldSlonyVacuumTable(prec.nspname, prec.relname) then
    		return next prec;
    	end if;
    	prec.nspname := '_schemadoc';
    	prec.relname := 'sl_confirm';
    	if ShouldSlonyVacuumTable(prec.nspname, prec.relname) then
    		return next prec;
    	end if;
    	prec.nspname := '_schemadoc';
    	prec.relname := 'sl_setsync';
    	if ShouldSlonyVacuumTable(prec.nspname, prec.relname) then
    		return next prec;
    	end if;
    	prec.nspname := '_schemadoc';
    	prec.relname := 'sl_seqlog';
    	if ShouldSlonyVacuumTable(prec.nspname, prec.relname) then
    		return next prec;
    	end if;
    	prec.nspname := '_schemadoc';
    	prec.relname := 'sl_archive_counter';
    	if ShouldSlonyVacuumTable(prec.nspname, prec.relname) then
    		return next prec;
    	end if;
    	prec.nspname := 'pg_catalog';
    	prec.relname := 'pg_listener';
    	if ShouldSlonyVacuumTable(prec.nspname, prec.relname) then
    		return next prec;
    	end if;
    	prec.nspname := 'pg_catalog';
    	prec.relname := 'pg_statistic';
    	if ShouldSlonyVacuumTable(prec.nspname, prec.relname) then
    		return next prec;
    	end if;
    
       return;
    end

Google

If this was useful, let others know by an Affero rating

Contact me at cbbrowne@acm.org