Re: return query execute SQL-problem - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: return query execute SQL-problem
Date
Msg-id 20121016093729.GA30368@depesz.com
Whole thread Raw
In response to return query execute SQL-problem  (Maximilian Tyrtania <lists@contactking.de>)
Responses Re: return query execute SQL-problem  (Maximilian Tyrtania <lists@contactking.de>)
List 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/


pgsql-general by date:

Previous
From: Sim Zacks
Date:
Subject: Re: Who is LISTENing?
Next
From: Maximilian Tyrtania
Date:
Subject: Re: return query execute SQL-problem