Re: a column definition list is required for functions returning "record"

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: a column definition list is required for functions returning "record"
Date: 2016-09-02 23:55:31
Message-ID: dd26b0ad-1938-3c0b-80de-a4fcfcedd22d@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/29/16 6:28 AM, Tom Lane wrote:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> > 2016-08-29 1:59 GMT+02:00 Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>:
>>> >> 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.
>> > Probably there is a space to be PLpgSQL more flexible - but there are
>> > limits - PLpgSQL is black box for SQL engine, and when output is any record
>> > type, then SQL engine knows zero about returning data structure in
>> > preprocessing time.
> Exactly. You can pass anonymous record types around today, as long as you
> don't do anything that requires knowing what their contents are, either in
> the function or in the calling query:

What I was thinking of is something (like a function) that has
explicitly defined what the contents of the record are.
--
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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2016-09-03 00:34:08 Re: What limits Postgres performance when the whole database lives in cache?
Previous Message Venkata B Nagothi 2016-09-02 23:26:59 Re: How to reduce WAL files in Point in time recovery