Slony-I 2.2.11 Documentation
Prev | Fast Backward | Chapter 8. Schema schemadoc | Fast Forward | Next

# 8.67. finishtableaftercopy(p_tab_id integer)

Function Properties

Language: PLPGSQL

Return Type: integer

Reenable index maintenance and reindex the table

    declare
    	v_tab_oid		oid;
    	v_tab_fqname	text;
    begin
    	-- ----
    	-- Get the tables OID and fully qualified name
    	-- ---
    	select	PGC.oid,
    			slon_quote_brute(PGN.nspname) || '.' ||
    			slon_quote_brute(PGC.relname) as tab_fqname
    		into v_tab_oid, v_tab_fqname
    			from sl_table T,
    				"pg_catalog".pg_class PGC, "pg_catalog".pg_namespace PGN
    				where T.tab_id = p_tab_id
    				and T.tab_reloid = PGC.oid
    				and PGC.relnamespace = PGN.oid;
    	if not found then
    		raise exception 'Table with ID % not found in sl_table', p_tab_id;
    	end if;

    	-- ----
    	-- Reenable indexes and reindex the table.
    	-- ----
    	perform enable_indexes_on_table(v_tab_oid);
    	execute 'reindex table ' || slon_quote_input(v_tab_fqname);

    	return 1;
    end;

Prev | Home | Next
failoverset_int(p_last_seqno integer, p_backup_node integer, p_failed_node bigint) | Up | forwardconfirm(p_con_timestamp integer, p_con_seqno integer, p_con_received bigint, p_con_origin timestamp without time zone)