在postgre中空字符串与null是不同的,所以不能用replace来替换
for循环打印void类型数据及更新操作
DO $$DECLARE r record;
BEGIN
FOR r IN SELECT column_name from information_schema.columns
where table_schema='public' and table_name='ods_card_d' and data_type='character varying'
LOOP
raise notice 'update ods_card_d set % =null where % =''null''',quote_ident(r.column_name),quote_ident(r.column_name);
EXECUTE 'update ods_card_d set '||quote_ident(r.column_name)||'=null where '||quote_ident(r.column_name)||'= ''null''';
END LOOP;
END$$;