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

From: nconway(at)klamath(dot)dyndns(dot)org (Neil Conway)
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:24:06
Message-ID: 20020729152406.GA7080@klamath.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Mon, Jul 29, 2002 at 11:03:40AM -0400, Tom Lane wrote:
> nconway(at)klamath(dot)dyndns(dot)org (Neil Conway) writes:
> > 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.

Right -- so when you declare the SRF, you could be allowed to define
a composite type that will be used if the caller doesn't specify one
(i.e. the default return type). This wouldn't get us a whole lot over
the existing 'CREATE VIEW' hack, except it would be cleaner.

> 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.

Ok -- it still seems worthwhile to me.

Cheers,

Neil

--
Neil Conway <neilconway(at)rogers(dot)com>
PGP Key ID: DB3C29FC

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-07-29 15:28:54 Re: question on backends
Previous Message Roderick A. Anderson 2002-07-29 15:07:08 Re: Why is MySQL more chosen over PostgreSQL?

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2002-07-29 15:30:59 Re: anonymous composite types for Table Functions (aka
Previous Message Tom Lane 2002-07-29 15:03:40 Re: anonymous composite types for Table Functions (aka SRFs)