pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Ing. Jhon Carrillo <jdigital@cantv.net>
Cc: pgsql-hackers@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Function .. AS..?
Date: Wed, 9 Feb 2005 23:16:19 -0700
Message-ID: <20050210061619.GA59420@winnie.fuhr.org> (raw)
In-Reply-To: <014201c50ee9$eee0dcd0$1400a8c0@tgusta2>
References: <014201c50ee9$eee0dcd0$1400a8c0@tgusta2>

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/



view thread (3+ messages)

Message-ID: <20050210061619.GA59420@winnie.fuhr.org>
Permalink:  ../20050210061619.GA59420@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050210061619.GA59420@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, jdigital@cantv.net, pgsql-hackers@postgresql.org
  Subject: Re: [SQL] Function .. AS..?
  In-Reply-To: <20050210061619.GA59420@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox