Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

From: Benedict Holland <benedict(dot)m(dot)holland(at)gmail(dot)com>
To: Thomas Kellerer <shammat(at)gmx(dot)net>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
Date: 2022-10-19 22:45:39
Message-ID: CAD+mzowp+CLMawgzdd5cnFjOKeKTY2uHLMmF_b91Y6htumvaGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This seems like a bad use of a stored procedure. Why wouldn't you spin up
40 clients with a table name and run it across 40 connections? But also, I
don't like loops in stored procedures. Working with loops in a set based
system hurts me but it's personal preference.

Like, I could write this in python in less than 4 hours with an extremely
simple sproc. How often are you running table deletions like this to
require a sproc?

Thanks,
Ben

On Wed, Oct 19, 2022, 5:39 PM Thomas Kellerer <shammat(at)gmx(dot)net> wrote:

> gogala(dot)mladen(at)gmail(dot)com schrieb am 19.10.2022 um 01:46:
> > Amazon, lead by Kevin Closson, the guy who has famously designed
> > Oracle Exadata among other things, even came up with the recipe how
> > to migrate it to Postgres:
> >
> >
> https://aws.amazon.com/blogs/database/migrating-oracle-autonomous-transactions-to-postgresql/
>
>
> The workaround to use dblink to simulate autonomous transactions is
> nothing new,
> and has been floating around for quite a while.
>
> Here is a blog post from 2012 (6 years before the Amazon recipe was
> published)
>
> https://raghavt.blog/autonomous-transaction-in-postgresql-9-1/
>
> and another one from 2016
>
> https://blog.dalibo.com/2016/09/08/Pragma_Autonoumous_transactions.html
>
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2022-10-19 22:48:28 Re: Postgres 15 upgrades and template1 public schema
Previous Message David G. Johnston 2022-10-19 22:16:40 Re: Column value derived from generated column in INSERT?