Re: Function .. AS..? - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: Function .. AS..?
Date
Msg-id 20050210061619.GA59420@winnie.fuhr.org
Whole thread Raw
In response to Function .. AS..?  ("Ing. Jhon Carrillo" <jdigital@cantv.net>)
List 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/


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: [HACKERS] Function .. AS..?
Next
From: KÖPFERL Robert
Date:
Subject: Re: parsing a string with a hexadecimal notation