Re: BUG #15246: Does not allow an INOUT parameter to receive valueswhen its data type is a user-defined data type.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #15246: Does not allow an INOUT parameter to receive valueswhen its data type is a user-defined data type.
Дата
Msg-id CAKFQuwYfUe7r43DC52u6YdDfBRepyT5d3VczcTtXUukE8QRscQ@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #15246: Does not allow an INOUT parameter to receive values whenits data type is a user-defined data type.  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #15246: Does not allow an INOUT parameter to receive values when its data type is a user-defined data type.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Mon, Jun 18, 2018 at 3:32 PM, PG Bug reporting form <noreply@postgresql.org> wrote:

begin
        p_my_type.rc_tbl1.co_1 := 1; -- ERRO:  "p_my_type.rc_tbl1.co_1" is not
variable unknown !!!!
        p_my_type.rc_tbl1.co_2 := 'Teeeeeeeeeest';
        p_my_type.rc_tbl2.co_3 := 'T';
        p_my_type.rc_tbl2.co_4 := 10.56;
end;

Short answer is that you cannot simply assign components of a composite type one-at-a-time, you have to build up the full final composite result in one expression and assign the result of the expression to the typed variable (p_my_type in this instance).​

​This works:

p_my_type := ROW(ROW(1, 'Teeeeeeeeeeest'), ROW('T', 10.56));

and execute:

​select * FROM fc_test(null)

David J.

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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15246: Does not allow an INOUT parameter to receive values whenits data type is a user-defined data type.
Следующее
От: Amit Langote
Дата:
Сообщение: Re: BUG #15245: pg_stat_all_tables does not include partition mastertables