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

2002-07-25 Thread Christopher Kings-Lynne
> The column names and types are determined in the parser, and used in the > planner, optimizer, and executor. I'm not sure how the backend could > plan a join or a where criteria otherwise. > > Remember that the function has to look just like a table or a subselect > (i.e a RangeVar). With a tabl

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

2002-07-24 Thread Zeugswetter Andreas SB SD
> > 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?

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

2002-07-24 Thread Christopher Kings-Lynne
> 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: >CREAT

[HACKERS] Proposal: anonymous composite types for Table Functions (aka SRFs)

2002-07-24 Thread Joe Conway
Hello all, There is a limitation currently with Table Functions in that the return tuple type must be known in advance, i.e. you need a pre-defined scalar or composite type to use as the function's declared return type. This doesn't work well for the type of function that needs to return diff