Re: PL/PGSQL Record type question - Mailing list pgsql-sql

From John DeSoi
Subject Re: PL/PGSQL Record type question
Date
Msg-id E161951A-9DDA-4ADA-BC9F-A356B3919A95@pgedit.com
Whole thread Raw
In response to Re: PL/PGSQL Record type question  (Gábriel Ákos <akos.gabriel@i-logic.hu>)
List 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



pgsql-sql by date:

Previous
From: Gábriel Ákos
Date:
Subject: Re: PL/PGSQL Record type question
Next
From: "Collin Peters"
Date:
Subject: Convert serial column to regular integer