Bug with function returning composite types.

Поиск
Список
Период
Сортировка
От Kyle Butt
Тема Bug with function returning composite types.
Дата
Msg-id 20090309144356.GB32830@North.cfl.rr.com
обсуждение исходный текст
Ответы Re: Bug with function returning composite types.
Список pgsql-bugs
Functions that return composite types are called more times than expected.

Example script:
---------------
begin;

create table composite_types_test (
    a integer,
    b integer,
    c integer,
    d integer,
    e integer,
    f integer,
    g integer,
    h integer,
    i integer,
    j integer
);

insert into composite_types_test values (0,1,2,3,4,5,6,7,8,9);

create function bug_function () returns composite_types_test
volatile
language plpgsql
as  $$
declare r composite_types_test;
begin
    select * into r from composite_types_test;
    raise notice 'in bug_function';
    return r;
end;
$$;

select bug_function();

select (bug_function()).*;
rollback;
---------------

Example Output:
---------------
BEGIN
CREATE TABLE
INSERT 0 1
CREATE FUNCTION
psql:sql/bug_example.sql:30: NOTICE:  in bug_function
     bug_function=20=20=20=20=20=20
-----------------------
 (0,1,2,3,4,5,6,7,8,9)
(1 row)

psql:sql/bug_example.sql:32: NOTICE:  in bug_function
psql:sql/bug_example.sql:32: NOTICE:  in bug_function
psql:sql/bug_example.sql:32: NOTICE:  in bug_function
psql:sql/bug_example.sql:32: NOTICE:  in bug_function
psql:sql/bug_example.sql:32: NOTICE:  in bug_function
psql:sql/bug_example.sql:32: NOTICE:  in bug_function
psql:sql/bug_example.sql:32: NOTICE:  in bug_function
psql:sql/bug_example.sql:32: NOTICE:  in bug_function
psql:sql/bug_example.sql:32: NOTICE:  in bug_function
psql:sql/bug_example.sql:32: NOTICE:  in bug_function
 a | b | c | d | e | f | g | h | i | j=20
---+---+---+---+---+---+---+---+---+---
 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
(1 row)

ROLLBACK
---------------

Kyle Butt

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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: (some) Indexes ignored after long-running UPDATE and REINDEX at the same time (8.3.6)
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Bug with function returning composite types.