[HACKERS] proposal: PLpgSQL parallel assignemnt - Mailing list pgsql-hackers

From Pavel Stehule
Subject [HACKERS] proposal: PLpgSQL parallel assignemnt
Date
Msg-id CAFj8pRAvBRgTWRSPf83z12Xyv0isTf8bjAfeOvYZqLxdH_k5WA@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] proposal: PLpgSQL parallel assignemnt  (Craig Ringer <craig@2ndquadrant.com>)
List 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

pgsql-hackers by date:

Previous
From: Rafia Sabih
Date:
Subject: Re: [HACKERS] statement_timeout is not working as expected with postgres_fdw
Next
From: Craig Ringer
Date:
Subject: Re: [HACKERS] proposal: PLpgSQL parallel assignemnt