returning a record from PL/pgSQL

From: KÖPFERL Robert <robert(dot)koepferl(at)sonorys(dot)at>
To:
Cc: pgsql-sql(at)postgresql(dot)org
Subject: returning a record from PL/pgSQL
Date: 2005-01-21 11:41:09
Message-ID: ED4E30DD9C43D5118DFB00508BBBA76EB1657C@neptun.sonorys.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I just tried hard to return
a single record fromout a plpgsql-function. While the (otherwise excelent)
documentation didn't give me an answer, I found out that this works:

select into ret false, balance, balance;
return ret;

while ret is a composite type.

This construction however tastes not good to me. Is there a nicer way?

An example for PL/pgSQL which returns not just a scalar but also a composite
type should be added to the documentation. i.e. as second part of the RETURN
statement.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joel Fradkin 2005-01-21 13:56:32 Re: still having pg_user error
Previous Message Andrei Bintintan 2005-01-21 09:20:48 Re: [SQL] OFFSET impact on Performance???