Re: a column definition list is required for functions returning "record" - Mailing list pgsql-general

From Jim Nasby
Subject Re: a column definition list is required for functions returning "record"
Date
Msg-id e9b9d379-a1a4-5e25-eda6-d09e09db5dd9@BlueTreble.com
Whole thread Raw
In response to Re: a column definition list is required for functions returning "record"  (Alexander Farber <alexander.farber@gmail.com>)
Responses Re: a column definition list is required for functions returning "record"  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
On 8/26/16 10:32 AM, Alexander Farber wrote:
> Thank you, I was just wondering if there is a simpler way... but ok

It would be nice if there was a way to pass dynamically formed records
around, similar to how you can pass the results of row() around. Someone
else has actually be asking about this at
https://github.com/decibel/pg_lambda/issues/1.

BTW, there's no advantage I can think of to using plpgsql just to return
the output of a query. You'd be better off using a SQL function instead.

Actually, I guess the plan for the plpgsql version would be cached; I'm
not sure if the same is true for SQL functions. But you'd probably need
a more complex query for that to be a win over the lighter weight nature
of SQL functions.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461


pgsql-general by date:

Previous
From: Edson Analista
Date:
Subject: Re: Error Upgrade PostgreSQL 9.4 to 9.5 in Debian - Solved
Next
From: Jim Nasby
Date:
Subject: Re: LOG: could not fork new process for connection: Cannot allocate memory