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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nconway(at)klamath(dot)dyndns(dot)org (Neil Conway)
Cc: Joe Conway <mail(at)joeconway(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: anonymous composite types for Table Functions (aka SRFs)
Date: 2002-07-29 15:03:40
Message-ID: 21232.1027955020@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

nconway(at)klamath(dot)dyndns(dot)org (Neil Conway) writes:
>> 1. Creates a new pg_type typtype: 'p' for pseudo type (currently either
>> 'b' for base or 'c' for catalog, i.e. a class).

> I think you mentioned that typtype could be renamed to typkind -- that
> sounds good to me...

It sounds like a way to break client-side code for little gain to me...

> Is there a reason why you can't specify the return type in the function
> declaration? ISTM that for most functions, the 'AS' clause will be the
> same for every usage of the function.

The particular functions Joe is worried about (dblink and such) do not
have a fixed return type. In any case that would be a separate
mechanism with its own issues, because we'd have to store the anonymous
type in the system catalogs.

>> SELECT * from foo(sqlstmt) AS f(f1 int, f2 text, f3 timestamp)

> What does the 'f' indicate?

It's required by the SQL alias syntax.

>> SELECT * from foo(sqlstmt) f(f1 int, f2 text, f3 timestamp)

> This form of the syntax seems a bit unclear, IMHO. It seems a bit
> like two function calls. Can the 'AS' be made mandatory?

Why? That just deviates even further from the spec syntax.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roderick A. Anderson 2002-07-29 15:07:08 Re: Why is MySQL more chosen over PostgreSQL?
Previous Message Neil Conway 2002-07-29 14:57:40 Re: anonymous composite types for Table Functions (aka SRFs)

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2002-07-29 15:24:06 Re: anonymous composite types for Table Functions (aka SRFs)
Previous Message Neil Conway 2002-07-29 14:57:40 Re: anonymous composite types for Table Functions (aka SRFs)