Re: [SQL] Function .. AS..?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Ing(dot) Jhon Carrillo" <jdigital(at)cantv(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Function .. AS..?
Date: 2005-02-10 06:16:19
Message-ID: 20050210061619.GA59420@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

On Wed, Feb 09, 2005 at 04:57:14PM -0400, Ing. Jhon Carrillo wrote:

> Those instructions are good but i want to call this function only
> for " select consulta_contacto(1)" nothing more, Is really necesary
> to use "AS ..."?
>
> this is the call:
>
> select * from consulta_contacto(1) as (cont_codigo integer,
> cont_idpers varchar,
> ...

Instead of declaring the function to return SETOF RECORD, you could
return SETOF typename, where "typename" is the name of a composite
type or a table; your queries could then omit "AS ...."

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2005-02-10 06:33:53 slow SP with temporary tables, any idea of solution?
Previous Message Stephan Szabo 2005-02-10 06:06:07 Re: Function .. AS..?

Browse pgsql-sql by date

  From Date Subject
Next Message KÖPFERL Robert 2005-02-10 09:37:02 Re: parsing a string with a hexadecimal notation
Previous Message Stephan Szabo 2005-02-10 06:06:07 Re: Function .. AS..?