1,查询表中有多少个索引,user_temp指的是表名
select * from pg_indexes where tablename='user_temp' ;
2: 把A表中的数据插入A表中
insert ino user1 select sys_guid(),
now(),
created_by
now(),
updated_by,
remark from user1 where row_id='12345611'
3:把A表中的数据插入B中
DO $$
<<FORST_BLOCK>>
DECLARE
I RECORD;
ALLNUM_integer;
cur_itvmh_ist record;
begin
fro cur_ltvmh_list in ( select client_no as client_no from vip_remp where created_by='yu2023' and length(client_no)>11 limit 20 ) LOOP
ALL_NUM:=ALL_NUM+1;
insert into vip_sx_tem ( row_id,created_date, client_no, remark)
select (select max(row_id)+1 from vip_sx_tem,
now(),
'yu',
cur_ltvm_list.client_no,
'测试');
if ALL_NUM>=100 then
commit;
end if ;
end loop;
commit;
END FIRST_BLOCK $$;