Re: Functions returning RECORD

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Craig Bryden <postgreSQL(at)bryden(dot)co(dot)za>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Functions returning RECORD
Date: 2005-01-13 20:37:36
Message-ID: 20050113203736.GA41320@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 13, 2005 at 07:58:33PM +0200, Craig Bryden wrote:

> When I run select * from GetAccountInfo (100) I get the following
> error message:
> ERROR: a column definition list is required for functions returning "record"

If the function will always return the same row type then create a
composite type with CREATE TYPE and return that instead of RECORD.

> please can someone explain to me how to create a column definition list.

See the documentation for SELECT in the Reference part of the
PostgreSQL documentation; the Examples section shows a query with
a column definition list. But you won't need a column definition
list if you return a known type instead of RECORD.

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2005-01-13 20:41:23 Re: Functions returning RECORD
Previous Message Scott Marlowe 2005-01-13 20:16:39 Re: Adding UNIQUE constraint on NULL column