Re: About Types

From: Havasvölgyi Ottó <h(dot)otto(at)freemail(dot)hu>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: About Types
Date: 2005-05-12 19:34:46
Message-ID: 001a01c55729$a7df44b0$9e00a8c0@OTTO
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi Hervé,

You should perhaps use record instead of a particular type.

... RETURNS SETOF record AS ...

Otto

----- Original Message -----
From: "Hervé Inisan" <typo3(at)self-access(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Thursday, May 12, 2005 8:31 PM
Subject: [GENERAL] About Types

Hi everybody,

I'm a PG newbie, and I'm trying to write a function that returns a set of
records.
These records come from 2 or more tables (joined).

When I have only 1 table, the return type of the function can be SETOF
mytable.
When I have 2 tables or more, am I obliged to create a type (CREATE TYPE) so
that my function can return a SETOF mytype?

This works fine, but I'm trying to avoid building a specific type for each
row returning function.
Is there any other solution (SQL or PLPGSQL)?

TIA,
-- Hervé Inisan.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

In response to

  • About Types at 2005-05-12 18:31:16 from Hervé Inisan

Browse pgsql-general by date

  From Date Subject
Next Message Zlatko Matic 2005-05-12 19:42:41 Re: MS-Access and Stored procedures
Previous Message Reid Thompson 2005-05-12 19:17:52 Re: pg_dump: ERROR: Memory exhausted in AllocSetAlloc(875574064)