Re: PL/PGSQL Record type question

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Gábriel Ákos <akos(dot)gabriel(at)i-logic(dot)hu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: PL/PGSQL Record type question
Date: 2007-05-11 15:12:56
Message-ID: E161951A-9DDA-4ADA-BC9F-A356B3919A95@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

You can use CREATE TYPE:

http://www.postgresql.org/docs/8.2/interactive/sql-createtype.html

Example from the documentation:

CREATE TYPE compfoo AS (f1 int, f2 text);

Then make your function return compfoo (or setof compfoo).
Alternately, you can define your function with out or in/out
parameters so you don't need the CREATE TYPE statement.

On May 11, 2007, at 10:42 AM, Gábriel Ákos wrote:

>> You might be looking for PostgreSQL RECORD data type.
>
> Thanks. Give me an example please. I saw the documentation already.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Collin Peters 2007-05-11 16:24:24 Convert serial column to regular integer
Previous Message Gábriel Ákos 2007-05-11 14:42:42 Re: PL/PGSQL Record type question