Re: Optimze usage of immutable functions as relation

Поиск
Список
Период
Сортировка
От rmrodriguez@carto.com
Тема Re: Optimze usage of immutable functions as relation
Дата
Msg-id CAM6_UM4isP+buRA5sWodO_MUEgutms-KDfnkwGmryc5DGj9XuQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Optimze usage of immutable functions as relation  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Optimze usage of immutable functions as relation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

This commit is breaking some Postgis tests with custom types.

Here is a minimal repro (Postgis not required)

```
-- test custom types
create type t_custom_type AS (
valid bool,
reason varchar,
location varchar
);

create or replace function f_immutable_custom_type(i integer)
returns t_custom_type as
$$ declare oCustom t_custom_type;
begin
select into oCustom true as valid, 'OK' as reason, NULL as location;
return oCustom;
end; $$ language plpgsql immutable;

select valid, reason, location from f_immutable_custom_type(3);

drop function f_immutable_custom_type;
drop type t_custom_type;
```

Expected (PG12):
```
valid | reason | location
-------+--------+----------
 t     | OK     |
(1 row)
```

Instead with master/HEAD (eb57bd9c1d) we are getting:
```
ERROR:  could not find attribute 2 in subquery targetlist
```

Reverting 8613eda50488c27d848f8e8caa493c9d8e1b5271 fixes it,
but I haven't looked into the reason behind the bug.

Regards
--
Raúl Marín Rodríguez
carto.com



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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: abort-time portal cleanup
Следующее
От: Andrew Gierth
Дата:
Сообщение: Excessive disk usage in WindowAgg