951
社区成员
发帖
与我相关
我的任务
分享
select table_name from information_schema.columns
CREATE OR REPLACE FUNCTION fff(count integer, table_name_ary text[])
RETURNS void
AS $$
declare
d_table_name text = null;
begin
for i in 1..count loop
d_table_name = table_name_ary[i];
ALTER TABLE d_table_name
ADD test_column text not null default '';
end loop;
end
$$ language plpgsql;
select ARRAY_AGG(distinct table_name) from (select distinct table_name from information_schema.columns) T;