Re: [GENERAL] return query execute SQL-problem

2012-10-16 Thread Maximilian Tyrtania
Am 16.10.2012 um 10:56 schrieb Condor : > You can use AS > select f_aliastest() AS alias; Yeah, thanks, well, my question is basically if there is a way to make the function alias-savvy. In the meantime I realized that the problem is not limited to return query execute SQL but to return query i

Re: [GENERAL] return query execute SQL-problem

2012-10-16 Thread David Johnston
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Maximilian Tyrtania > Sent: Tuesday, October 16, 2012 3:44 AM > To: pgsql-general@postgresql.org > Subject: [GENERAL] return query execute SQL-problem > > Hi there, >

Re: [GENERAL] return query execute SQL-problem

2012-10-16 Thread Maximilian Tyrtania
Am 16.10.2012 um 11:37 schrieb hubert depesz lubaczewski : > create or replace function f_aliastest(OUT alias TEXT) returns setof record > AS … Ah, yes, I forgot about the OUT parameters, thanks for the reminder! Maximilian Tyrtania Contact King Software Entwicklung Maximilian Tyrtania http://w

Re: [GENERAL] return query execute SQL-problem

2012-10-16 Thread hubert depesz lubaczewski
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 ca

Re: [GENERAL] return query execute SQL-problem

2012-10-16 Thread Condor
On 2012-10-16 10:44, Maximilian Tyrtania wrote: Hi there, here is something I don't quite grasp (PG 9.1.3): This function: CREATE OR REPLACE FUNCTION f_aliastest() RETURNS setof text AS $BODY$ declare sql text; begin sql:='SELECT ''sometext''::text as alias'; return query execute SQL; end