proposal: PLpgSQL parallel assignemnt

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: proposal: PLpgSQL parallel assignemnt
Date: 2017-06-02 07:51:55
Message-ID: CAFj8pRAvBRgTWRSPf83z12Xyv0isTf8bjAfeOvYZqLxdH_k5WA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

Some modern or old languages (GO, Lua, CLU) has similarly designed function
OUT parameters like PLpgSQL.

In these languages is usually supported parallel assignment. It is not
supported by PLpgSQL - there is workaround - using SELECT FROM, but it is
workaround. The implementation of PA is trivial.

Current state:
==========

CREATE OR REPLACE FUNCTION fx(OUT a int, OUT b int)
AS $$ ...

possibilities of CALL and assignment

recvar := fx();
rowvar := fx();

SELECT * FROM fx() INTO a, b;

Lua, Golang like proposal:

a, b := fx();

Comments, notes, ideas?

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2017-06-02 08:06:39 Re: proposal: PLpgSQL parallel assignemnt
Previous Message Rafia Sabih 2017-06-02 07:48:57 Re: statement_timeout is not working as expected with postgres_fdw