Why I need to use SETOF TEXT when I'm returning single column?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Why I need to use SETOF TEXT when I'm returning single column?
Date: 2011-02-09 14:47:21
Message-ID: 20110209144721.GA19957@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

If I'll make my functions like this:

create function test( out a text, out b text) returns setof record ...

it works well.
but if i have just one column in returned recordset, I cannot:
create function test( out a text ) returns setof record ...
shows:
ERROR: function result type must be text because of OUT parameters

it's bad because I can't have the column names the way I want it to be
named! (well, I could, using custom datatype, but it's besides the
point.

is there any particular reason why returning single-column "setof
record" is not allowed?

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/
jid/gtalk: depesz(at)depesz(dot)com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2011-02-09 14:52:55 Re: pg_restore validation?
Previous Message Adrian Klaver 2011-02-09 14:44:25 Re: Possible Bug