pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John DeSoi <desoi@pgedit.com>
To: Gábriel Ákos <akos.gabriel@i-logic.hu>
Cc: pgsql-sql@postgresql.org
Subject: Re: PL/PGSQL Record type question
Date: Fri, 11 May 2007 11:12:56 -0400
Message-ID: <E161951A-9DDA-4ADA-BC9F-A356B3919A95@pgedit.com> (raw)
In-Reply-To: <20070511164242.7ed1f046@gabriel-laptop>
References: <20070511160037.1c09160e@gabriel-laptop>
	<1f30b80c0705110709u73519990gd6623c6a4c81ee55@mail.gmail.com>
	<20070511164242.7ed1f046@gabriel-laptop>

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




view thread (7+ messages)  latest in thread

Message-ID: <E161951A-9DDA-4ADA-BC9F-A356B3919A95@pgedit.com>
Permalink:  ../E161951A-9DDA-4ADA-BC9F-A356B3919A95@pgedit.com/
Also on:    postgresql.org/message-id/E161951A-9DDA-4ADA-BC9F-A356B3919A95@pgedit.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: desoi@pgedit.com, akos.gabriel@i-logic.hu
  Subject: Re: PL/PGSQL Record type question
  In-Reply-To: <E161951A-9DDA-4ADA-BC9F-A356B3919A95@pgedit.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox