Search Postgresql Archives

[PL/pgSQL] Commit every N rows. Is it possible ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm still trying to convert my PL/SQL stored procedures into PL/pgSQL. Now, I have problem with commiting transaction every N rows:

loop
fetch csr_ac into row_id;
   if not FOUND then
      exit;
   end if;
   counter := counter + 1;
   delete from spm_audit where adt_id=row_id;
   delete from spm_audit_pipeline_data where apd_adt_id=row_id;
   global_counter := global_counter + 1;
   if counter = rows_between_commit then
   counter := 0;
   commit;
   end if;
end loop;

I'm digging into postgresql documentation but maybe I'm just not smart enough to understand the way which transactions are being processed into pgSQL. Is it possible to port above code to PL/pgSQL ?

Kind Regards.

--
-- audi vide sile --

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux