Re: Incorrect display type of the function result

From: Алексей Лутовинин <crossrw1(at)gmail(dot)com>
To: "Guillermo E(dot) Villanueva" <guillermovil(at)gmail(dot)com>
Cc: pgadmin-support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Incorrect display type of the function result
Date: 2015-04-22 17:20:34
Message-ID: CAKu6uVZNukKuXegoW7=L=n9b9gmZsTw02hFCeS4+6Od=CANqmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Yes, very similar.

2015-04-22 6:23 GMT+03:00 Guillermo E. Villanueva <guillermovil(at)gmail(dot)com>:

> What you say is almost the same as I reported
>
> Guillermo Villanueva
>
>
> 2015-04-20 11:45 GMT-03:00 Алексей Лутовинин <crossrw1(at)gmail(dot)com>:
>
> Hello!
>>
>> pgAdmin 1.20.0 (Dec 16 2014, rev: REL-1_20_0)
>> OS: Windows 7/64.
>>
>> Create a function that returns a table with a column "col1":
>>
>> CREATE OR REPLACE FUNCTION myfunc()
>> RETURNS TABLE(col1 text) AS
>> $BODY$
>> SELECT 'aaa'::text;
>> $BODY$
>> LANGUAGE sql STABLE;
>>
>> After creating a look at the source code of the function in the object
>> browser:
>>
>> CREATE OR REPLACE FUNCTION myfunc()
>> RETURNS SETOF text AS
>> $BODY$
>> SELECT 'aaa'::text;
>> $BODY$
>> LANGUAGE sql STABLE
>> COST 100
>> ROWS 1000;
>> The type of result of the function is shown as "SETOF text" instead "TABLE(col1
>> text)", column name "col1" is lost.
>> Despite this, the name of the column "col1" is present in the results:
>>
>> SELECT * FROM myfunc();
>>
>> col1 !
>> text !
>> ----------+-
>> aaa |
>>
>> Сommand-line utility "psql" returns (\df+) correct value of function type.
>>
>>
>

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message danny 2015-04-27 22:41:51 Basics
Previous Message Wander Nauta 2015-04-22 16:01:37 Re: pgadmin3 segfaults on leaving context menu