Index: src/backend/slony1_funcs.sql =================================================================== RCS file: /home/cvsd/slony1/slony1-engine/src/backend/slony1_funcs.sql,v retrieving revision 1.145 diff -c -u -r1.145 slony1_funcs.sql --- src/backend/slony1_funcs.sql 17 Nov 2008 22:39:47 -0000 1.145 +++ src/backend/slony1_funcs.sql 18 Dec 2008 21:23:00 -0000 @@ -5424,10 +5424,6 @@ -- ---- execute 'alter table @NAMESPACE@.sl_node drop column no_spool;'; - -- ---- - -- create new type - vactables - used by TablesToVacuum() - -- ---- - execute 'create type @NAMESPACE@.vactables as (nspname name, relname name);'; end if; -- ---- @@ -5669,6 +5665,23 @@ comment on function @NAMESPACE@.ShouldSlonyVacuumTable (name, name) is 'returns false if autovacuum handles vacuuming of the table, or if the table does not exist; returns true if Slony-I should manage it'; +create or replace function @NAMESPACE@.setup_vactables_type () returns integer as $$ +begin + if not exists (select 1 from pg_catalog.pg_type t, pg_catalog.pg_namespace n + where n.nspname = '_@CLUSTERNAME@' and t.typnamespace = n.oid and + t.typname = 'vactables') then + execute 'create type @NAMESPACE@.vactables as (nspname name, relname name);'; + end if; + return 1; +end +$$ language plpgsql; + +comment on function @NAMESPACE@.setup_vactables_type () is +'Function to be run as part of loading slony1_funcs.sql that creates the vactables type if it is missing'; + +select @NAMESPACE@.setup_vactables_type(); + +drop function @NAMESPACE@.setup_vactables_type (); -- ---------------------------------------------------------------------- -- FUNCTION TablesToVacuum()