Something's busted in plpgsql composite-variable handling

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Something's busted in plpgsql composite-variable handling
Дата
Msg-id 13185.1535309409@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Something's busted in plpgsql composite-variable handling
Список pgsql-hackers
While answering someone's question I was motivated to try this:

regression=# create type comp_type as (f1 int, f2 int);
CREATE TYPE
regression=# create function foo(int) returns int language plpgsql as '
declare z comp_type;
begin
  z.f1 = $1; z.f2 = $1+1;
  return z.f1 + z.f2;
end';
CREATE FUNCTION
regression=# select foo(32);
 foo 
-----
  65
(1 row)

regression=# drop type comp_type;
DROP TYPE
regression=# create type comp_type as (f1 int, f2 int);
CREATE TYPE
regression=# select foo(32);
ERROR:  could not open relation with OID 52068
CONTEXT:  PL/pgSQL function foo(integer) line 4 at assignment

That's not very nice.  What's worse is that it works cleanly in v10,
making this a regression, no doubt caused by the hacking I did on
plpgsql's handling of composite variables.

I'll create an open item for this.  I've not yet looked into it
in any more detail than observing the failure.

            regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Multiple reporting of syslogger errors
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Something's busted in plpgsql composite-variable handling