Re: Proposal: anonymous composite types for Table Functions (aka SRFs)

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Joe Conway" <mail(at)joeconway(dot)com>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: anonymous composite types for Table Functions (aka SRFs)
Date: 2002-07-25 02:14:28
Message-ID: GNELIHDDFBOCMGBFGEFOIEFECDAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> 3. Modify FROM clause grammer to accept something like:
> SELECT * FROM my_func() AS mtf(colname1 type1, colname2 type1, ...)
> where mtf is the table alias, colname1, etc are the column names, and
> type1, etc are the column types.

...

> Now when creating a function you can do:
> CREATE FUNCTION foo(text) RETURNS setof RECORD ...
>
> And when using it you can do, e.g.:
> SELECT * from foo(sqlstmt) AS (f1 int, f2 text, f3 timestamp)

Why is there the requirement to declare the type at SELECT time at all? Why
not just take what you get when you run the function?

Chris

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2002-07-25 02:18:54 RESET SESSION AUTHORIZATION
Previous Message Yuva Chandolu 2002-07-24 23:24:59 savepoint and rollback queries in postgres

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2002-07-25 03:40:43 regression test fix
Previous Message Rod Taylor 2002-07-25 01:24:08 Re: small psql patch - show Schema name for \dt \dv \dS