Search Postgresql Archives

Re: About Types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



pgsql-general-owner@xxxxxxxxxxxxxx wrote:
> 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)?

Yes, return setof record, look at this site, it helped me  a lot.

http://techdocs.postgresql.org/guides/SetReturningFunctions

---
Miguel

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux