Hello,I have a function to add column to all tables from the list:do$$declarerelnam pg_class.relname%TYPE;kur cursor for select c.relnamefrom pg_class as cinner join pg_attribute as a on a.attrelid = c.oidwhere a.attname = 'some_id' and c.relkind = 'r';beginopen kur;LOOPFetch kur into relnam;exit when not found;EXECUTE 'ALTER TABLE '|| relnam|| ' add column another_id integer default -1';END LOOP;close kur;END;$$I have 22 table names returned by the query used by cursor. Whe I run the function it executes for 1.5 minutes. Is there a way of doing it faster?
I suspect your default is the cause of the problem.
David J.