Just to save anyone else reading through these the time it took for me
to figure this out, this was resubmitted as bug #5353, and Tom replied
to that one.

...Robert

2010/2/26 Oleg Serov <sero...@gmail.com>:
> Hello!? anybody will fix this bug? Hey!
>
> On Mon, Feb 23, 2009 at 5:11 PM, Oleg <sero...@gmail.com> wrote:
>>
>> The following bug has been logged online:
>>
>> Bug reference:      4673
>> Logged by:          Oleg
>> Email address:      sero...@gmail.com
>> PostgreSQL version: 8.3.6
>> Operating system:   i686-redhat-linux-gnu
>> Description:        pl/PgSQL: Bug, when updating changed composite types.
>> Details:
>>
>> If you added a field into composite type(table type), plpgsql won't update
>> it, until you recompile function.
>>
>> DEMO SQL:
>>
>> ROLLBACK;
>> BEGIN;
>> CREATE TABLE bug_composite (
>>        column_a INT,
>>        column_b INT
>> );
>>
>> CREATE TABLE bug_parent (
>>        id INT,
>>        info bug_composite
>> );
>>
>> INSERT INTO bug_parent(id, info) VALUES (1, ROW(1, 2));
>>
>> CREATE OR REPLACE FUNCTION bug_update(r bug_parent) RETURNS void
>> AS
>> $BODY$
>> BEGIN
>>        UPDATE bug_parent
>>                SET info = r.info
>>                WHERE id = r.id;
>> END;
>> $BODY$ LANGUAGE 'plpgsql' VOLATILE;
>>
>> SELECT bug_update(ROW(1, ROW(3, 5)));
>>
>> SELECT * FROM bug_parent; -- WE WILL HAVE ROW(1, ROW(3, 5));
>>
>> ALTER TABLE bug_composite ADD COLUMN column_c INT;
>>
>> SELECT * FROM bug_parent; -- WE WILL HAVE ROW(1, ROW(3, 5, NULL));
>>
>> SELECT bug_update(ROW(1, ROW(4, 6, 9)));
>>
>> SELECT * FROM bug_parent; -- WE WILL HAVE ROW(1, ROW(4, 6, NULL));
>>
>> SELECT version(); -- "PostgreSQL 8.3.6 on i686-redhat-linux-gnu, compiled
>> by
>> GCC gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)"
>>
>> --
>> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-bugs
>
>
>
> --
> С уважением
>
> Олег Серов
>

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to