Re: Autonomous transactions 2023, WIP

From: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
To: Ivan Kush <ivan(dot)kush(at)tantorlabs(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Autonomous transactions 2023, WIP
Date: 2023-12-21 11:26:43
Message-ID: C25D9369-1176-4FD8-8BDD-8D9434CBDBD2@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 15 Dec 2023, at 16:28, Ivan Kush <ivan(dot)kush(at)tantorlabs(dot)com> wrote:
>
>
>
> Hello. I'm working on the support of autonomous transactions in Postgres.
>

> # Summary
> * Add pragma AUTONOMOUS_TRANSACTION in the functions. When function
> contains this pragma, the it's executed autonomously
> * Background workers are used to run autonomous sessions.
> * Synchronous execution between backend and autonomous session
> * Postgres Client-Server Protocol is used to communicate between them
> * Pool of autonomous sessions. Pool is created lazily.
> * Infinite nested calls of autonomous functions are allowed. Limited
> only by computer resources.
> * If another 2nd autonomous function is called in the 1st autonomous
> function, the 2nd is executed at the beginning, and then the 1st
> continues execution.

Cool, looks interesting! As far as I know EnterpriseDB, Postgres Pro and OracleDB have this functionality. So, seems like the stuff is in demand.
How does your version compare to this widely used databases? Is anyone else using backgroud connections? Which syntax is used by other DBMS'?

Looking into the code it seems like an easy way for PL\pgSQL function to have a client connection. I think this might work for other PLs too.

The patch touches translations ( src/backend/po/). I think we typically do not do this in code patches, because this work is better handled by translators.

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-12-21 11:27:41 Re: [PoC] Improve dead tuple storage for lazy vacuum
Previous Message Andres Freund 2023-12-21 11:25:32 Re: Track in pg_replication_slots the reason why slots conflict?