Re: return query execute SQL-problem

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Maximilian Tyrtania <lists(at)contactking(dot)de>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: return query execute SQL-problem
Date: 2012-10-16 09:37:29
Message-ID: 20121016093729.GA30368@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 16, 2012 at 09:44:03AM +0200, Maximilian Tyrtania wrote:
> Is there a way that I can make my function return the field aliases?

CREATE OR REPLACE FUNCTION f_aliastest() RETURNS setof text AS

function defined as above returns set of values without any name. name
is chosen by pg.
you can't rename the columns in the "return query" part, but you can by
changing definition of function to:
create or replace function f_aliastest(OUT alias TEXT) returns setof record AS ...

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
http://depesz.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Maximilian Tyrtania 2012-10-16 09:59:25 Re: return query execute SQL-problem
Previous Message Sim Zacks 2012-10-16 09:35:38 Re: Who is LISTENing?