Re: Redundant explicit field name/types description while select from function with return type of record

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Redundant explicit field name/types description while select from function with return type of record
Дата
Msg-id 3663.1206716130@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Redundant explicit field name/types description while select from function with return type of record  (<Eugen.Konkov@aldec.com>)
Список pgsql-bugs
<Eugen.Konkov@aldec.com> writes:
> PG v8.3.1
> CREATE or REPLACE FUNCTION "public"."aaa"()
> RETURNS SETOF "pg_catalog"."record" AS
> $BODY$
> DECLARE r record;
> BEGIN
> select 1 as num  into r; -- here PG know that first field is integer and has
> name 'num'
> return next r;
> return;
> END;
> $BODY$
> LANGUAGE 'plpgsql' VOLATILE;

> select * from aaa()

> Expected result:
> num
> --------
> 1

This is not a bug.  The semantics of a query have to be determinable
without looking "inside" the bodies of functions it calls.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG: wrong doc or wrong connectby?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: FOR-IN-EXECUTE: FOR does not replanned on each entry to the FOR loop