plpgsql - execute - cannot use a reference to record field

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема plpgsql - execute - cannot use a reference to record field
Дата
Msg-id CAFj8pRA=ThwGSUDaNcA-Jky9JUz7uz-M=pxu7x9RXj4mc4_xpw@mail.gmail.com
обсуждение исходный текст
Ответы Re: plpgsql - execute - cannot use a reference to record field  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi

Is there reason why following code should not to work?

do $$
declare r record; result int;
begin
  select 10 as a, 20 as b into r;
  raise notice 'a: %', r.a;
  execute 'select $1.a + $1.b' into result using r;
  raise notice '%', result;
end;
$$

but it fails

NOTICE:  a: 10
ERROR:  could not identify column "a" in record data type
LINE 1: select $1.a + $1.b
               ^
QUERY:  select $1.a + $1.b
CONTEXT:  PL/pgSQL function inline_code_block line 6 at EXECUTE

Regards

Pavel

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Issue in ExecCleanupTupleRouting()
Следующее
От: Ramanarayana
Дата:
Сообщение: Mailing list not working